Silverlight 调用 JavaScript window.alert/prompt 时 Windows Safari 冻结

发布于 2024-12-21 07:11:34 字数 728 浏览 2 评论 0原文

我有一个 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.alertwindow.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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

叹沉浮 2024-12-28 07:11:34

我在使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文