« Return to Thread: behaviors context

Re: behaviors context

by Daniel F. Kudwien :: Rate this Message:

Reply to Author | View in Thread

> The context is supposed to be the element to be
> processed--not a jQuery object but the page element. See the
> 5 - 6 upgrade notes:
> http://drupal.org/node/114774#javascript-behaviors
>
> However, this fact may have been lost along the way.

Note that even misc/ahah.js passes an jQuery object:

  if (new_content.parents('html').length > 0) {
    Drupal.attachBehaviors(new_content);
  }


However, passing a string as context sounds a bit wrong.  Behaviors usually
expect a DOM element.

sun

 « Return to Thread: behaviors context