Error message: "A script on this page is causing Internet Explorer to run slowly"


Because some scripts may take an excessive amount of time to run, Internet Explorer prompts the user to decide whether to continue running the slow script. Some tests and benchmarks may use scripts that take a long time to run. Therefore, you may want to increase the amount of time that passes before the message box appears. In Internet Explorer, the script time-out value can be changed on specific client computers by modifying a registry entry.

More Information

Sometimes, a webpage contains script that takes an unusually long time to run. If you are scripting an ActiveX control on a webpage to transfer a very large file or run a large database query, this often causes a significantly long delay. Internet Explorer 3.02 detects the long delay, and prompts the user with a dialog box that reads as follows:
This page contains a script which is taking an unusually long time to finish. To end this script now, click Cancel.
The equivalent message box for Internet Explorer versions 4.0 through 8 reads as follows:
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?
This mechanism allows the user to stop misbehaved script that runs into an endless loop or otherwise is performing slowly.

In Internet Explorer 3.02, this message box can appear on machines running Windows 95. The version 3.02 browser is specifically looking to see if the script thread has pumped any windows messages in the last five seconds. There is no way to override this time-out period for Internet Explorer 3.02. If you are using an ActiveX control with long blocking operations, that ActiveX control should either employ an event mechanism and return control to the caller or call PeekMessage every five seconds to reset the time-out.

As of Internet Explorer 4.0 and later versions, the time-out is no longer a fixed value based on Windows messages. 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. Because of this mechanism, it is possible to execute more than the default limit without the dialog if the entire script execution finishes before the script engine polls Internet Explorer.

To have us change this time-out value in Internet Explorer versions 4.0 through 8 for you, go to the "Fix it for me" section. If you prefer to fix this problem yourself, go to the "Let me fix it myself" section.

Fix it for me

To fix this problem automatically, click the Fix it button or link, click Run in the File Download dialog box, and then follow the steps in the Fix it wizard.

  • This wizard may apply to the English version only. However, the automatic fix also works for other language versions of Windows.
  • If you are not on the computer that has the problem, save the Fix it solution to a flash drive or a CD, and then run it on the computer that has the problem.

Next, go to the "Did this fix the problem?" section.

Let me fix it myself

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 How to back up and restore the registry in Windows

To change this time-out value in Internet Explorer versions 4.0 through 8, follow these steps:
  1. Using a Registry Editor such as Regedt32.exe, open this key:
    HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Styles

    Note If the Styles key is not present, create a new key that is called Styles.
  2. Create a new DWORD value called "MaxScriptStatements" under this key, and set the value to the desired number of script statements. If you are not aure about which value you need to set this to, you can set it to a DWORD value of 0xFFFFFFFF to avoid the dialog box.
By default, the key does not exist. If the key has not been added, the default threshold limit for the time-out dialog box is 5,000,000 statements for Internet Explorer 4 and later versions.

Because the Internet Explorer versions 4.0 through 8 time-out is based on the number of script statements that are executed, the time-out dialog box does not display during ActiveX control or database-access delays. Endless loops in script will still be detected.

Did this fix the problem?

  • Check whether the problem is fixed. If the problem is fixed, you are finished with this section. If the problem is not fixed, you can contact support.
  • We would appreciate your feedback. To provide feedback or to report any issues with this solution, please leave a comment on the "Fix it for me" blog or send us an


For more information about speed, security, and adaptability of Internet Explorer 8, visit the following Microsoft Web site: