Welcome, Guest

Can This Prevent 'Stop running this script' in IE
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Can This Prevent 'Stop running this script' in IE

Can This Prevent 'Stop running this script' in IE 1 year, 9 months ago #16355

I keep getting the 'Stop running this script' message in Internet Explorer and no were else. My form can't be reduced in size and I only have a couple visibility rules.

However, I did find this...
http://www.picnet.com.au/blogs/Guido/post/2010/03/04/How-to-prevent-Stop-running-this-script-messagehttp://www.picnet.com.au/blogs/Guido/post/2010/03/04/How-to-prevent-Stop-running-this-script-message-in-browsers.aspx

the simplest solution is to just break up your task into mutliple smaller tasks with a setTimeout in between these tasks. The utility class below does just this:

Utility Class

RepeatingOperation = function(op, yieldEveryIteration) {
var count = 0;
var instance = this;
this.step = function(args) {
if (++count >= yieldEveryIteration) {
count = 0;
setTimeout(function() { op(args); }, 1, [])
return;
}
op(args);
};
};

So how do we use this class, lets say we have the following code which is giving us a jerky browser and occasionally displaying those horrible 'Stop running this script' message:



// initdata is just an array of numbers (a very very large array)
var test1 = new Array(initdata.length);
for (var i = 0; i < initdata.length; i++) { test1[i] = initdata[i] * 2; } // Double each item in the initdata array
continueOperations();

To use the utility class above we would change the code to this:



var test2 = new Array(initdata.length);
var i = 0;
var ro = new RepeatingOperation(function() {
test2[i] = initdata[i] * 2;
if (++i < initdata.length) { ro.step(); }
else { continueOperations(); }
}, 100);
ro.step();

That's it, a little bit more code, an extra closure, so not pretty but I think a relativelly stylish solution to a nasty problem. Note: Remember this will also give you a much more responsive browser during execution of this expensive code also.



I'm not a code guy so I don't know how to implement it. Could someone more knowledgeable give me a hand?
  • paco2paco3
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0

Re: Can This Prevent 'Stop running this script' in IE 1 year, 8 months ago #17224

To the moderator: We are also having this problem on our form. You can see the error for yourself if you need to. Go to "192.168.10.47/joomla". With IE as your browser, go to the change form link. On laod, the script error stuff will happen. No other browsers, but as we know, IE is still (why I don't know) the most popular browser, so if this can't be remedied with IE, we can't use the software.

We attempted to get to the actual code from the form we built with the quickform editor and insert pauses as recommended elsewhere on this site, but there doesn't seem to be a way to obviously do that.

Any help from admins or moderators would be returned with the utmost gratitude.
  • kadavila
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0

Re: Can This Prevent 'Stop running this script' in IE 1 year, 3 months ago #28905

I have this problem too. Help would be appreciated. Thank you.
  • rokada
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0
  • Page:
  • 1
Moderators: TheMuffinMan, ForumSupport
Time to create page: 0.29 seconds

Facebook Discount - 40% Off!

Fans of our Facebook page here are entitled to get a 1-year-subscription for the price of a 6-months!

Steps to take:

  • Become a fan on Facebook (Like) here
  • Purchase a 6-months-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of your like and we'll upgrade to the 1-year-subscription

Joomla!® Forms Discount - 40% Off!

Already purchased a forms extension from a different vendor but your requirements changed and now you need a forms extension that is capable of more than just the standards? We help you to keep the costs for a change under control: Get a 40% discount on our professional membership plan! -- meaning timely unlimited access to all current and future commercial extensions, breezingforms themes & apps and Joomla!® templates at crosstec.de, including 1 year of support -- without any website limitations -- Just prove that you previously purchased another forms extension for Joomla!® from a different vendor and you are qualified.

Steps to take:

  • Purchase a 1-year-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of the purchase for the other form vendor and we'll upgrade to the professional-subscription

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany

Imprint