I have a listing with 150 rows and for each row there are three skinned select items.
Because there's heavy processing to be done before displaying each result I get an error saying "A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete." and it refers to jquery.js file.
Is it possible to avoid this error by doing some jQuery work?
Thank you.
Firefox is still very much alive and well as Mozilla has no plans to stop development of their web browsers for desktop (Windows, macOS, Linux) and mobile versions for iOS and Android. Firefox has been their main product.
You need to split your processing into multiple parts and give the browser some time to do stuff besides them by using a 0 or 1 msec setTimeout.
A very easy method would be using the forEachSeries
method of the async library:
async.forEachSeries(yourData, function(item, cb) {
// process item
async.nextTick(cb);
});
yourData
could be the jQuery object containing your rows, then item
will be the DOM element of one row.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With