I'm curious what you find ugly about setTimeout, and how jQuery could improve on it.
I don't see much if any difference between: $(foobar).click( function() { // called on click }); and: setTimeout( function() { // called on timeout }, 1000 ); They look like extremely similar styles of coding to me. -Mike On Wed, Dec 16, 2009 at 2:04 AM, jez9999 <jez9...@gmail.com> wrote: > Hi, > > It rather surprised me that one of the things I had to turn to a > plugin for was a timer. It seems like the kind of thing that would > frequently be useful to have, abstracted to a nice jQuery interface, > rather than using directly the rather ugly setTimeout function in > Javascript. Why not implement a timer interface in the jQuery core? > > You could also then take this one step further and use 1ms one-off > timers to implement multithreaded programming through jQuery, too. I > think this should work - a Javascript engine has to have the ability > to do multithreading if several timers can callback over time whilst > other JS code may be executing, right? So we could have a timer and > multithreads abstracted out nicely in the jQuery core. Both would be > nice. > > -- > > You received this message because you are subscribed to the Google Groups > "jQuery Development" group. > To post to this group, send email to jquery-...@googlegroups.com. > To unsubscribe from this group, send email to > jquery-dev+unsubscr...@googlegroups.com<jquery-dev%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/jquery-dev?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-...@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.