[development] insert a javascript header

Tao Starbow starbow at citris-uc.org
Tue Jan 22 18:19:08 UTC 2008

You can use hook_init, but you need to check if you are serving a cached 
page or not. Just check for the existence of some function that will 
only be there on a full bootstrap.  I am assuming you are talking about 
Drupal 5. In Drupal 6 you don't need to do the check  (and, last time I 
tested, drupal_add_js wasn't working in hook_footer in Drupal 6).


Alex Moreno wrote:
> Hi everybody,
> i´m trying to insert a javascript line from a custom module. I´ve seen
> the hook_footer module and it does exactly what i need but not in the
> header section as i need.
> a link t some code should be a great help.
> thanks a lot in advance.

More information about the development mailing list