Joined December 2012
·

Pierre Buyle

Phéromone
·
Montréal
·
·
·

@angel alvarado
The attach method of a behavior is only a substitute to jQuery.ready(). In the attach method of a behavior, you can still uses jQuery's .on() to bind handlers, even with event delegation (using .delegate() in older jQuery version, or .on() in jQuery 1.7+). The only case where not using a behavior would make sense is to attach an handler to the document element. Any other element, including the body, could be added/replaced in JavaScript, so a behavior is needed to ensure whoever add/replace the element after the DOM ready event can still get your event handler attached. So I think it is safer and easier to always use behaviors as replacement of jQuery.ready().

You can also use the drush.complete.sh script directly fron your Drush installation, simply add the following to either your ~/.bashcompletion or ~/.bashprofile file:

source /path/to/drush/drush.complete.sh
Achievements
314 Karma
16,574 Total ProTip Views