[jQuery] Re: behaviors?

2007-04-30 Thread Aaron Heimlich
Well, DOM2 does define Mutation Events[1], which seem to be what you're looking for, but I dunno how many browsers actually support them. You could trigger custom events inside append(), prepend(), etc., but I dunno how well that will run. [1]

[jQuery] Re: behaviors?

2007-04-30 Thread Scott Sauyet
Aaron Heimlich wrote: Well, DOM2 does define Mutation Events[1], which seem to be what you're looking for, but I dunno how many browsers actually support them. You could trigger custom events inside append(), prepend(), etc., but I dunno how well that will run. They don't seem well

[jQuery] Re: behaviors?

2007-04-30 Thread Brandon Aaron
Yeah I have an idea... I'm going to go see if it works. :) -- Brandon Aaron On 4/30/07, John Resig [EMAIL PROTECTED] wrote: Excellent Brandon, this is a great start. I suspect that in order to get a full behavior plugin (one the feels natural) it'll require a lot of code extensions. Hmm... I

[jQuery] Re: behaviors?

2007-04-30 Thread Brandon Aaron
Okay ... I've created a jQuery.fn.behavior() and jQuery.fn.unbehavior(). I haven't checked anything in yet but I have uploaded it to here: http://brandon.jquery.com/plugins/behavior/test/test.html I also added a pretty rough $.behavior.find() so that unbehavior will work. The only extension I

[jQuery] Re: behaviors?

2007-04-30 Thread Mike Alsup
Brandon, This is really, really cool! I think this is functionality that belongs in core as it solves an extremely common use case (and addresses the most commonly asked question regarding ajax usage). Awesome job! Mike Okay ... I've created a jQuery.fn.behavior() and

[jQuery] Re: behaviors?

2007-04-30 Thread Brandon Aaron
Thanks Mike! My vote is to expose the selector and context on the jQuery object as properties and leave this as an official plugin ... at least for now. John, what are your thoughts about adding the selector and context properties to jQuery? I know this isn't the first time I've wanted to get

[jQuery] Re: behaviors?

2007-04-28 Thread Brandon Aaron
I had some down time this afternoon so I thought I would throw something together real quick. I just checked it in: http://dev.jquery.com/browser/trunk/plugins/behavior This allows you to register any number of behaviors that will run any jQuery method/plugin with any number of arguments. It

[jQuery] Re: behaviors?

2007-04-28 Thread Mike Alsup
Brandon, That is really slick! Mike http://dev.jquery.com/browser/trunk/plugins/behavior

[jQuery] Re: behaviors?

2007-04-27 Thread Chris W. Parker
On Thursday, April 26, 2007 2:19 PM Starbow said: I was just watching the video of John Resig at Yahoo, and in one slide he talked about behaviors... Are you talking about this? Advancing Javascript with Libraries http://video.yahoo.com/video/play?vid=410472 Thanks, Chris.

[jQuery] Re: behaviors?

2007-04-27 Thread Jonathan Sharp
Could you see this possibly being built directly into the browser or becoming part of the JavaScript/DOM standard? -js On 4/26/07, John Resig [EMAIL PROTECTED] wrote: .behavior() does not exist - but it could (without too much effort) the current solution with jQuery is shown in the

[jQuery] Re: behaviors?

2007-04-26 Thread Jonathan Sharp
I think he may be talking about something different, think dynamic events in the sense that a new list item is added via an ajax call and the click event is bound to it. No need to re-call the bind to attach the event after the ajax content has loaded... $('li).behavior( click, function() {