Use hook_menu. It is only on all non-cached pages when enabled. Since cached pages already have it included, no need to worry about that. But, you will need to clear cache if you have it enabled.
function mymodule_menu($may_cache) {
drupal_add_js('misc/myjquery.js');
// Other hook_menu info
}
Comments
Use hook_menu. It is only
Use hook_menu. It is only on all non-cached pages when enabled. Since cached pages already have it included, no need to worry about that. But, you will need to clear cache if you have it enabled.
-Craig Jackson
-Web Developer
thanks
I knew it would be something simple, I just couldn't find anything about it. That worked great.
Re:
I use this,
function mymodule_init(){
$path = drupal_get_path('module', 'mymodule');
drupal_add_js($path .'/activeshare.js', 'module', 'header', TRUE);
}
The original method was for
The original method was for Drupal 5 - it won't work on Drupal 6. Your method is correct for Drupal 6.
Contact me to contract me for D7 -> D10/11 migrations.