Drupal behaviors
问题 What are Drupal behaviors at all? What type of service layer it offers to module developers? What type of relation it maps to jQuery.ready ? 回答1: Long version : Drupal.behaviors is not simply a replacement for jQuery.ready since the latter only runs once (when DOM is ready for manipulation): behaviors can be fired multiple times during page execution and can be run whenever new DOM elements are inserted into the document. Also, modules could override or extend an existing behavior (e.g. if