Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Stop running this script?" error

I am developing a site that makes extensive use of JavaScript (jQuery). I regularly get the IE 'Stop running this script?' error dialog when I try to close the browser.

I'm guessing the problem occurs because the site is a single page that uses AJAX, so there are no postbacks to reset IE's count of commands executed.

Client-side registry hacking is not an option.

Does anyone know a way to get around this error?

UPDATE: The page has a number (~10) interval timers that poll continually on 30 or 60 second intervals.

like image 316
liammclennan Avatar asked Nov 17 '08 22:11

liammclennan


People also ask

What does stop running this script message mean?

A script on this page may be busy or may have stopped responding. You have the choice of "Stop Script" or "Continue" buttons. Click the "Stop Script" button to stop the script from running. Stopping the script can prevent the browser from running out of memory or crashing.


2 Answers

I have also faced this issue and had overcame this issue by dividing the continous DOM executio. For this approach, I used setTimeout function. Resolving this issue completely depends on how you are dividing the continuous execution.

like image 55
Narsi Avatar answered Oct 03 '22 16:10

Narsi


Do you by chance use a window.onunload handler? If you do, you might check that you don't have an infinite loop in there.

To check, at the bottom of your javascript do:

window.onunload = null;

and test again.

like image 34
Eric Wendelin Avatar answered Oct 03 '22 18:10

Eric Wendelin