Blair,  this is a great idea.

I don't know if you considered this and maybe I did it wrong myself
since I'm still new to jQuery, but when I prepare a time like so:

  $(function() {
     setInterval( function() {
     $('#result').load('/someurl');
     }, 10000 );  // repeat every 10 seconds
  });

What bugs me is that triggers it only the 10 seconds is reached.  I
would like for it to start the event immediately and from that point
on, do the interval event.   In short, in the example above, the user
has to wait 10 seconds before anything happens.   To get around this I
had to call the url first:

  $('#result').load('/someurl');
  $(function() {
     setInterval( function() {
     $('#result').load('/someurl');
     }, 10000 );  // repeat every 10 seconds
  });

Something trivial of course, but a pain in the butt (a PITA <g>) to
have to "duplicate" a line, sort of anti-jQuery. :-)

Anyway, maybe your plugin would take into account, if not already, an
option to start immediately or wait until the first event timeout.

Thanks

--
HLS

On Aug 14, 11:59 am, Blair Mitchelmore <[EMAIL PROTECTED]>
wrote:
> everyTime, et. al. seems to be short yet distinct. I've also been
> thinking of adding an option to skip the function call if the previous
> call hasn't completed yet (inspired by the $.interval method recently
> posted to the list) so a new release with that feature and the changed
> method names might come out later this week.
>
> And thanks for the mod approval. I guess I shouldn't have changed the
> e-mail address I was using on the mailing list.
>
> -blair
>
> On Aug 14, 10:26 am, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
>
> > I'm going to throw my suggestion in:
>
> > $(...).oneTime();
> > $(...).everyTime();
> > $(...).stopTime();
>
> > Cheers,
> > -js
>
> > P.S. I approved your account so there shouldn't be a delay anymore.
>
> > On 8/14/07, Blair Mitchelmore <[EMAIL PROTECTED]> wrote:
>
> > > Maybe it's just my jealousy of pattern matching and multi-methods that
> > > makes me want that particular solution. I definitely think that jQuery
> > > is getting big enough that some form of plugin hierarchy would be
> > > nice. (Though I'm perhaps a tad too modest to want a namespace for
> > > myself. perhaps $(...).timer.start() ?)
>
> > > I recall from last summer there was some discussion of namespacing of
> > > plugins and john didn't seem to think it would be a huge technological
> > > hurdle but it didn't really go anywhere. Personally, I think that
> > > direct namespacing like that removes some of the brevity and
> > > simplicity of jQuery. Though perhaps an importing system could be
> > > used.
>
> > > jQuery.import("timer");
>
> > > jQuery(...).stop(); // stops timer events not animations
>
> > > But this is all a discussion better suited for the dev list.
>
> > > -blair
>
> > > On Aug 14, 9:52 am, Stephan Beal <[EMAIL PROTECTED]> wrote:
> > > > On Aug 14, 3:34 pm, Blair Mitchelmore <[EMAIL PROTECTED]>
> > > > wrote:
>
> > > > > (Though I think the next step in improving how plugins interoperate is
> > > > > allowing multiple plugins to operate under the same name by having the
> > > > > plugin provide some sort of argument test to determine if the provided
> > > > > arguments are valid and then using that plugin on a case by case
> > > > > basis)
>
> > > > i think namespaces would be a better idea, e.g.:
>
> > > > $(...).blair.start(...);
> > > > $(...).blair.stop(...)
>
> > > > i don't know if that type of thing is possible using the current jQ
> > > > code. That sounds like a good question for the list.

Reply via email to