在 XUL 中打开一个窗口
尝试在 XUL 中使用 window.open 打开窗口时抛出异常。异常详细信息: 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");
谁能告诉我如何解决这个问题。
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:
The line of code throwing the exception is:
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果其他人也有同样的问题,这里是答案:
http://forums.mozillazine.org/viewtopic.php?t=421261
如果 prefs.js 中有这样一行:
pref("toolkit.defaultChromeURI", "chrome://myapp/content/myapp.xul");
你必须添加另一行,如下所示:
pref("browser.chromeURL", "chrome://myapp/content/myapp.xul");
In case someone else has the same problem here is the answer:
http://forums.mozillazine.org/viewtopic.php?t=421261
If you have a line in prefs.js like this:
pref("toolkit.defaultChromeURI", "chrome://myapp/content/myapp.xul");
you have to add another one line like this:
pref("browser.chromeURL", "chrome://myapp/content/myapp.xul");
我有一个 XULRunner 应用程序。我的窗口打开行如下:
注意到其中没有空格吗?尝试按照我的方式格式化它,它应该可以工作。
另一个提示:
I have an XULRunner app. my window open line is as follows:
Notice how there are no spaces? Try formatting it exactly like mine is and it SHOULD work.
Another tip: