如何检查Javascript语句运行的数量?
IE8 向我发出了并不罕见的“此页面上的脚本导致您的浏览器运行缓慢”警告。当然,这只发生在 IE 中,其他浏览器中不会发生。我正在使用 Infragistics jQuery 网格控件,它似乎会引起警告。
经过一些研究,我了解到,虽然几乎所有其他浏览器都根据执行时间(通常为 5 或 10 秒)显示警告,但 IE 却根据处理的语句数量(500 万条语句)来显示警告。
我想确定它是网格控件而不是其他东西。有没有办法可以查看已处理的语句数量,也许可以使用 Firebug 或 IE 开发人员工具之类的工具?
IE8 is giving me the not-uncommon "A script on this page is causing your browser to run slowly" warning. Of course this only happens in IE and not in any other browser. I am using an Infragistics jQuery grid control that seems to be causing the warning.
On doing a little bit of research I learnt that while nearly every other browser displays the warning based on execution time (generally 5 or 10 secs), IE does it based on number of statements processed (5 million statements).
I want to be sure it is the grid control and not something else. Is there a way I can see the number of statements processed, maybe using something like Firebug or the IE developer tools?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
IE8 内置了一个分析器,但似乎没有人知道它的存在。 IEBlog 有一个 不错的文章解释了 IE8 处于测试版时探查器的功能。
IE8 has a profiler built in and it seems like no one knows it exists. IEBlog had a nice article explaining the profiler's features when IE8 was in BETA.
如果您使用的是 IE8,请按 F12 键,您将获得一个 javascript 调试器,单步执行代码并找到问题。
If you are using IE8 hit the F12 key and you will get a javascript debugger, step through the code and find the issue.
Firebug或者chrome开发工具,可以看到执行的时间线。
Firebug or chrome dev tools, you can see the timeline of execution.