[英]NPAPI plugin, removeChild from web page crashes Firefox4 & Chrome
[英]MS Office Firefox Plugin (NPAPI)
我无法使用Microsoft Office 2010插件在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不是函数
有人可以指出我要去哪里了吗?
为了使链接正常工作,我进行了另一项更改。
目前,您有:
hownowPlugin.EditDocument2(url, null);
我删除了2:
hownowPlugin.EditDocument(url, null);
FFWinPlugin的文档可以在http://msdn.microsoft.com/zh-cn/library/ff407576.aspx中找到。
我正在做一个类似的项目,需要支持多个浏览器。 我最初的编辑代码来自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>
顺便说一句,我在Firefox中无法正常工作。 值得一提的是,文档路径必须是绝对路径,而不是相对路径。
var hownowPlugin = document.getElementById("winFirefoxPlugin");
var version = hownowPlugin.GetOfficeVersion();
hownowPlugin.EditDocument("http://example.com/word.doc", version);
我没有该插件,但也许由于错字(Microsoft页面上的错误)而无法使用。 你有
type=”application/x-sharepoint"
代替
type="application/x-sharepoint"
(第一引号)
还给!
在<!doctype html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.