Silverlight 调用 JavaScript window.alert/prompt 时 Windows Safari 冻结
我有一个 Siverlight 应用程序,它需要从托管它的网页获取一些内容。所以我在 Silverlight 中使用 HtmlPage.Window.Invoke("JS_OpenProject")
。
以下是 JavaScript 代码:
function JS_OpenProject() {
// window.alert also crashes
window.alert("Here is a window.alert");
// window.prompt also crashes
//var result = window.prompt("Please input the id of the project to be opened:", "12345");
return result;
}
每次调用 JavaScript 方法 JS_OpenProject
时,Safari 都会冻结。如果我删除 window.alert
和 window.prompt
,那就没问题了。
在 Windows 上,我使用 JavaScript 调用 IE、Chrome 和 Firefox 测试了我的 Silverlight 应用程序,一切正常,但只有 Safari。
我用谷歌搜索了很多,但没有运气。
请指教!
谢谢。
彼得
I have a Siverlight application, which needs to get something from the web page that hosts it. So I'm using HtmlPage.Window.Invoke("JS_OpenProject")
in Silverlight.
Here is the JavaScript code:
function JS_OpenProject() {
// window.alert also crashes
window.alert("Here is a window.alert");
// window.prompt also crashes
//var result = window.prompt("Please input the id of the project to be opened:", "12345");
return result;
}
Safari freezes every time when the JavaScript method JS_OpenProject
is called. If I remove the window.alert
and window.prompt
, it's fine.
On Windows, I tested my Silverlight application with JavaScript calling against IE, Chrome and Firefox, everything works fine, but just the Safari.
I have googled a lot, but no luck.
Please advise!
Thanks.
Peter
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在使用 FireFox 时遇到了同样的问题,现在似乎已得到纠正。当 Silverlight 在无窗口模式下运行时,就会出现问题。
如果您不需要它,请将其关闭,它会运行得更快。
I had the same problem with FireFox and that seems to have been corrected now. The problem arises when Silverlight is run in windowsless mode.
If you don't need it turn it off, it will run even faster.