clearTimeout() as soon as you can clearInterval() same as above or in window unload event
On Oct 23, 5:49 am, gMinuses <gminu...@gmail.com> wrote: > You mean those timers should be reset in the "unload" event? I thought > the browser was gonna do the job. Anyway, thanks for mentioning! > > On Oct 23, 4:40 pm, DBJDBJ <dbj...@gmail.com> wrote: > > > > > Agreed: QUNIT could be documented better. > > > BTW: Just to be sure "we are by the book" ;o) > > I would be so bold to recommend ,instead of this : > > > setTimeout(function() { > > $(window).unbind('hashchange'); > > start(); > > }, 500) > > > doing this : > > > var tid = setTimeout(function() { > > clearTimeout(tid); delete tid ; > > $(window).unbind('hashchange'); > > start(); > > }, 500) > > > And in the case of setInterval : > > > top.intervalTimer = setInterval ( ..... ) ; > > > $(window).unload( function () { > > clearInterval( top.intervalTimer ) ; delete top.intervalTimer ; > > > }) ; > > > It is a somewhat moot point how are the timers implemented and in > > which browser and their versions. > > So, it does not hurt using them "by the book". I cleraly remember I > > had solved some very misterious behaviors in IE6&7 with timer re- > > seting, > > but that was a long time ago so I can not exactly say what it was. > > > --DBJ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---