IE错误“停止运行此脚本” [英] IE Error "Stop Running This Script"
问题描述
有时,当你的剧本太大时,
IE给你一个警告停止运行这个脚本
此页面上的脚本导致Internet Explorer运行缓慢。
有谁知道,如何更正?
谢谢。
2008-10-20 20:19,Sunny写道:
有时,当你的脚本太大时,
IE给你一个警告停止运行这个脚本
此页面上的脚本导致Internet Explorer运行慢慢地。
有谁知道,如何纠正?
这不是特定于IE的,它发生在所有浏览器中。如果一个脚本是
不停地运行一段时间,例如因为无限循环,
(现代)浏览器为你提供了中断它的机会。 />
如果你的脚本真的需要工作很长时间,你可以将执行中的
分成更小的部分。例如,如果您在浏览器[0]中使用
javascript进行蛋白质
折叠计算,光线追踪或气象模拟,则可以运行
n次迭代,然后调用
setTimeout(" continueCalculations()",delay-in-ms)来做下一个
< blockquote> n
迭代。重复并冲洗。
([0]实际上至少有两个光线追踪实现
javascript。这些天人们真的很疯狂。不确定
蛋白质折叠,但我不会感到惊讶。)
- 康拉德
Hi,
Sometime, when your script is too big,
IE Gives you a warning "Stop Running This Script"
A script on this page is causing Internet Explorer to run slowly.
Does anyone knows, How to correct that?
Thanks.
On 2008-10-20 20:19, Sunny wrote:Sometime, when your script is too big,
IE Gives you a warning "Stop Running This Script"
A script on this page is causing Internet Explorer to run slowly.
Does anyone knows, How to correct that?This is not IE-specific, it happens in all browsers. If a script is
running non-stop for some time, for example because of an endless loop,
(modern) browsers offer you a chance to interrupt it.
If your script really has to work for a very long time, you could split
up execution into smaller parts. For example, if you''re doing protein
folding calculations, or raytracing, or meteorological simulations with
javascript in a browser[0], you could run
n iterations, then call
setTimeout("continueCalculations()", delay-in-ms) to do the next
n
iterations. Repeat and rinse.
([0] There are actually at least two raytracing implementations in
javascript. People are really going crazy these days. Not sure about the
protein folding, but I wouldn''t be surprised.)
- Conrad
这篇关于IE错误“停止运行此脚本”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!