21 May
2007
21 May
'07
3:59 p.m.
Option #3 is the best one, if the situation permits it. Wim On May 21, 2007, at 10:33 , Fernando Silva wrote:
Hi everyone,
Assuming that we want to reduce the size of JavaScript transfered to the client we have some options: * always call drupal_add_js() in hook_menu() because it will be download only once to the entire site?
* is there other place where we can call drupal_add_js() in a global way? hook_init() probably not because it does not get executed with "aggressive cache" I think...
* only call drupal_add_js() when we are going to use some of it, in the current page?
Regards, Fernando Silva