Drupal 7: JavaScript

James O’Beirne gibt einige Tips wie man JavaScript Dateien in Drupal 7 sinnvoll einbindet und wie man JavaScript Funktionen mit Behaviors aufruft.

Instead, the better way to include foobar_block_accordionizer.js would be to find a hook that is unique to the foobar block and include the JS file in the body of that hook.