javascript - 在 IE 中分析长时间运行的 javascript

标签 javascript internet-explorer

我有一个 javascript 页面,IE 确定它没有响应。 Firefox 在同一页面上运行良好。我应该如何调试这个问题?我不确定 Firebug 的分析器在评估问题时是否准确?

最佳答案

IE8 也有一个你可以使用的调试器;只需按 F12 并开始逐步执​​行它。您还可以使用 console.log 添加日志语句,您可以看到 IE 的控制台输出。一旦找到长时间运行的 JS,就可以使用 setTimeout 调用将其分解。

这篇知识库文章解释了长时间运行的脚本计时器的工作原理:http://support.microsoft.com/kb/175500

Internet Explorer now tracks the total number of executed script statements and resets the value each time that a new script execution is started, such as from a timeout or from an event handler, for the current page with the script engine. Internet Explorer displays a "long-running script" dialog box when that value is over a threshold amount. Internet Explorer doesn’t check on each instruction to see if it is over the limit. Periodically the script engine polls Internet Explorer with the number of statements executed and Internet Explorer checks if that is over the limit.

请注意,本文中描述的修复仅针对您的本地计算机,不会为其他用户修复您的代码(也就是说,它会告诉您如何更改注册表设置以延长定时器...这对你没用)。

关于javascript - 在 IE 中分析长时间运行的 javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5053171/

相关文章:

javascript - JQuery .trigger click 事件在 IE 下不工作

javascript - 未捕获的类型错误 : Illegal invocation in Javascript (geolocation)

c# - gridview 停止在 Javascript 中具有带有 IF 条件的母版页的所有页面上工作

javascript - 使用 Jquery 进行注释

jquery - 如果我在提交按钮上放置脚本,Internet Explorer 将不会回发表单

javascript - 如何将 JavaScript 打包为 .NET Internet Explorer 9 插件?

javascript - IE7 默认表单方法是 "GET"。我如何判断它是用户输入的还是默认的?

javascript - 努力获取修改后的 JSON 格式的图表

javascript - 添加记录到网格 ext js 3.4

asp.net - 在单独的选项卡/窗口中打开 PDF