cowboy / jquery-dotimeout

jQuery doTimeout: Like setTimeout, but better!
http://benalman.com/projects/jquery-dotimeout-plugin/
GNU General Public License v2.0
273 stars 34 forks source link

New feature to force_mode call #2

Open writeson opened 14 years ago

writeson commented 14 years ago

I'd like to propose a new feature for doTimeout to get around a problem that I've found on IE (8) and Chrome. Here is an example of the code with a comment about the problem :

http://jsfiddle.net/d2HLc/6/

Essentially the problem is I need to call $.doTimeout("id_of_function", true); with a delay so the first call (in my case a call to an Ajax function) succeeds. Without the delay I always get the error callback from the Ajax function. What I'm doing to get resolve this now is this:

setTimeout('$.doTimeout("id_of_function", true);', 500);

Thanks for your help! Doug

cowboy commented 13 years ago

Can you add comments inline, in your JavaScript to help clarify things? I'm having a little difficulty understanding exactly what the problem is.