我在使用微软Office2010插件在FireFox中打开Microsoft Office文档时遇到了麻烦。
请参阅http://msdn.microsoft.com/en-us/library/ff407576.aspx
我正在用firefox中的以下html文档来尝试它。我已确认已安装MS Office 2010插件。
<doctype html>
<html>
<head>
<script>
function OpenWebDavDocument(url, extension) {
debugger;
var hownowPlugin = document.getElementById("winFirefoxPlugin");
hownowPlugin.EditDocument2(url, null)
}
</script>
</head>
<body>
<object id="winFirefoxPlugin" type=”application/x-sharepoint">
<a href="#" onclick="OpenWebDavDocument('bfd42001/hownow/files/Records/12182', 'xlsx')" style="">Excel Doc</a>
<a href="#" onclick="OpenWebDavDocument('hbfd42001/hownow/files/Records/8924', 'docx')" style="">Word Doc</a>
</body>
</html>在FireBug中检查时出现以下错误:
hownowPlugin.EditDocument2不是一个函数
有谁能指出我哪里错了吗?
发布于 2012-05-23 03:10:43
为了让链接起作用,我还做了一个额外的修改。
目前,您拥有:
hownowPlugin.EditDocument2(url, null);我删除了2:
hownowPlugin.EditDocument(url, null);可以在http://msdn.microsoft.com/en-us/library/ff407576.aspx上找到FFWinPlugin的文档。
我正在做一个类似的项目,我需要支持多个浏览器。我最初的编辑代码来自于Milton ( http://milton.io/index.html )。它只在IE中有效。把IE代码和Firefox代码放在一起,我就能想出这个。
<script type="text/javascript">
var fNewDoc = false;
var EditDocumentButton = null;
try {
EditDocumentButton = new ActiveXObject('SharePoint.OpenDocuments.3');
if (EditDocumentButton != null) { fNewDoc = true; }
} catch(e) {}
var L_EditDocumentError_Text = "Editing not supported.";
var L_EditDocumentRuntimeError_Text = "Sorry, couldn't open the document.";
function editDocument(strDocument) {
if (fNewDoc) {
if (!EditDocumentButton.EditDocument(strDocument)) {
alert(L_EditDocumentRuntimeError_Text);
}
} else {
try {
var hownowPlugin = document.getElementById("winFirefoxPlugin");
hownowPlugin.EditDocument(strDocument, null);
} catch (e) { alert(L_EditDocumentError_Text); }
}
}
</script>
<object id="winFirefoxPlugin" type="application/x-sharepoint" width="0" height="0" style="visibility: hidden;"></object>发布于 2012-01-03 10:40:48
我没有那个插件,但可能是因为打字错误(微软页面上的错误),所以它不能工作。你有
type=”application/x-sharepoint"而不是
type="application/x-sharepoint"(第一句话)
还可以在<!doctype html>中提供!
发布于 2013-04-08 06:22:48
顺便说一句,我在Firefox中工作时遇到了麻烦。值得一提的是,文档的路径需要是绝对的,而不是相对的。
var hownowPlugin = document.getElementById("winFirefoxPlugin");
var version = hownowPlugin.GetOfficeVersion();
hownowPlugin.EditDocument("http://example.com/word.doc", version);https://stackoverflow.com/questions/8706668
复制相似问题