Is there anything inherently wrong with using setTimeout to simulate a parallel action?
blocking, javascript, user-experience
Solution
One thing that can go horribly wrong is that having too many high-frequency timers can [ironically] make the ui sluggish/unresponsive. From http://googlecode.blogspot.com/2009/07/gmail-for-mobile-html5-series-using.html:
With low-frequency timers — timers with a delay of one second or more — we could create many timers without significantly degrading performance on either device. Even with 100 timers scheduled, our app was not noticeably less responsive. With high-frequency timers, however, the story was exactly the opposite. A few timers firing every 100-200 ms was sufficient to make our UI feel sluggish.
Problem
When the users of this app make changes to the fields a large amount of changes need to happen across other fields. Typically even with optimized scripts the browser will block user input for upwards of 1 second in IE. To stop with from occurring I do this: ``` var i = 100; GetTextInputs().filter('[' + name + ']').each(function() { setTimeout("DoWork('" + this.id + "', '" + v + "', '" + name + "');", i); i += 25; }); ``` It feels kind of hackish to me but works great. - Can anything go wrong with this method? - Alternatively, is there a better way?