<< Go Back
A Script On This Page Is Causing Internet Explorer To Run Slowly If It Continues To Run Your Computer May Become Unresponsive
- 23 Sep 2008
**Your get one of these errors when running Internet Explorer:
** Stop running this script?
A script on this page is causing Internet Explorer to run slowly.
If it continues to run, your computer might become unresponsive.
“A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive.” “Do you want to abort the script?”
**Explanation:
** When Internet Explorer runs more than 5 million lines of script, you will get this error. If you choose to continue, the counter is reset and after another 5 million lines of script, you will get the error again.
**Workarounds:
** Reduce the number of iterations/statements in the code. If you run Process Monitor and see what registry keys are read, you will see a client side registry key related to lines of code but this is not practical to use because you would not be able to push this registry setting down to all clients. Also, since it is not documented, it is not supported.
Sample to create the problem:
<font color=#0000ff size=2><font color=#0000ff size=2><p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
«/span>html><?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
«/span>head></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"></head></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">«/span>script<font color=#000000> </font>language=”javascript”></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> </font>var<font color=#000000> totCount=0;</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> </font>function<font color=#000000> loopy()</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> {</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> </font>// i – 100K iteration loop</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> </font>for<font color=#000000> (</font>var<font color=#000000> i=0; i<100000; i++) </font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> {</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> jloop();</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> }</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> alert (totCount);</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> }</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> </font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> </font>function<font color=#000000> jloop()</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> {</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> </font>// 10 iterations (1 million total with this)</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> </font>for<font color=#000000> (</font>var<font color=#000000> j=0; j<10; j++) </font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> {</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> kloop();</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> }</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> }</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> </font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> </font>function<font color=#000000> kloop()</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> {</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> </font>//k – 5 iterations </p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> </font>for<font color=#000000> (</font>var<font color=#000000> k=0; k<5; k++) </font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> {</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> totCount++; </font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> }</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> }</font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"><font color=#000000> </font></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"></script></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"> </p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">«/span>body></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">«/span>input<font color=#000000> </font>type=”submit”<font color=#000000> </font>name=”btn_Login”<font color=#000000> </font>value=”Login”<font color=#000000> </font>onclick=”loopy(); “<font color=#000000> </font>language=”javascript”<font color=#000000> </font>id=”btn_Login”<font color=#000000> </font>/></p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"> </p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"></body></p>
</html><p mce_keep="true"> </p>
</font></font>
<< Go Back