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 previous slide (which
is, unfortunately, rather verbose). I hope that it'll exist one day -
I probably should've made that more explicit.

You would, "simply", have to override append/prepend/before/after and
after the injection has occurred, re-run all "behavior"ed expressions.
Of course, you'd also have to cache all expressions for future use
(and that's another nut, entirely). If someone feels compelled, you
can hack on it - otherwise, I may take a stab at it.

--John

On 4/26/07, Starbow <[EMAIL PROTECTED]> wrote:
>
> I was just watching the video of John Resig at Yahoo, and in one slide
> he talked about behaviors, as jquery bindings that act like css rules
> and apply themselves to html fragments asynchronously loaded into the
> page.  The code sample looked like this:
>
> $(document).ready( function() {
>   $('li").behavior( "click", function() {
>     $(this).load("menu.html");
>   });
> });
>
> Is behavior a special jQuery function, something that is in the works,
> or is it just a regular function and the code for it was missing from
> the slide set?
>
>

Reply via email to