问题描述
尝试在 XUL 中使用 window.open 打开窗口时抛出异常.异常详情:Exception...组件返回失败代码:0x80004005(NS_ERROR_FAILURE)[nsIDOMJSWindow.open]"nsresult:0x80004005(NS_ERROR_FAILURE)"位置:
An exception is being thrown when trying to open a window using window.open in XUL. The exception details: Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMJSWindow.open]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location:
抛出异常的代码行是:
newWind = window.open(settings.url, "Dialog", "chrome = yes, width=" +
settings.width + ",height=" + settings.height +
",resizable = yes,scrollbars=yes");
谁能告诉我如何解决这个问题.
Can anyone please tell me how to get round this problem.
推荐答案
如果其他人有同样的问题,这里是答案:http://forums.mozillazine.org/viewtopic.php?t=421261
In case someone else has the same problem here is the answer:http://forums.mozillazine.org/viewtopic.php?t=421261
如果您在 prefs.js 中有这样一行:pref("toolkit.defaultChromeURI", "chrome://myapp/content/myapp.xul");
If you have a line in prefs.js like this:pref("toolkit.defaultChromeURI", "chrome://myapp/content/myapp.xul");
你必须像这样添加另一行:pref("browser.chromeURL", "chrome://myapp/content/myapp.xul");
you have to add another one line like this:pref("browser.chromeURL", "chrome://myapp/content/myapp.xul");
这篇关于在 XUL 中打开一个窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!