Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop running this script

Tags:

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.

I'm sure we've all seen this useful and informative error message from IE7 (or rather IE8 in IE7 mode). I need some help with removing this message.

So, for my work, I need to get our website working in IE7. Apparently, some of our clients can't upgrade or use another browser (corporate regulations or something).

Anyway, the page in question contains tabs (using jQueryUI). After the page loads, jQuery loads the data for each tab using AJAX; the tabs are loaded one by one, using a queue. In each tab, there are 'widgets' which contain HTML and JavaScript (for each tab load, there are various script tags).

I am getting the 'slow script' error during the loading of the tabs. I know that IE hates when scripts don't return control to the browser. So, I was wondering if there was a way to 'return control' or sleep somehow, so IE can 'reset' it's slow script counter.

like image 555
Rocket Hazmat Avatar asked Apr 14 '11 17:04

Rocket Hazmat


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.

How do I stop a script from running in Windows?

Start Task Manager, click on the Processes tab, right-click on wscript.exe and select End Process, and confirm in the dialog that follows. This will terminate the wscript.exe that is executing your script.


1 Answers

Someone came up with an idea here

Avoiding the 'Script taking too long' (all browsers have some form or another of this) message in browsers is relatively simple. You just have to make sure the browser knows you have not created an endless loop or recursion. And the easiest way to do is is to just give the browser a breather in between long running tasks.

So how would we go about this. Well the simplest solution is to just break up your task into mutliple smaller tasks with a setTimeout in between these tasks. The utility (see link) does just this

like image 167
Ron Harlev Avatar answered Sep 20 '22 15:09

Ron Harlev