HI I’m iterating control from webpage, i’m getting script unresponsive error if controls are more than 500, though as per my requirement control can grow. I’m using following code.
function callme(val1,val2){
(var i=0;i<1750;i++)
{
var val=some custom function();
var val3=some custom function();
callme(val,val3)
}
}
How to prevent this situation, so that all recursive call should run in asynchronous order.
Kindly suggest.
Thanks in advance.
First of all, having 500 controls in a page is not really a good idea. You might want to look at pagination/splitting based on what your page and code is supposed to be doing.
Async is an option if call me does not return a value and you are not worried about updating the UI immediately. You could set the recursive call to run async by using setTimeout.