On Apr 26, 2007, at 17:18 , Starbow 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?

Looks like a typo for .bind(). This will work:

$(document).ready(function() {
  $('li').bind('click', function() {
    $(this).load('menu.html');
  });
});

Reply via email to