hi,
I want to add a javascript file to a module..I found that i can add it using drupal_add_js($data = NULL, $type = 'module', $scope = 'header', $defer = FALSE, $cache = TRUE)...
can anybody tell me in which hook i will have to call this ...???and if my javascript file is in the same folder then this is the right statement :drupal_add_js(".js/javascript1.js") ....??

Thank you in advance.....

Comments

alim418’s picture

if you have your javascript under "your_module/javascript1.js"
then you have to this

drupal_add_js(drupal_get_path('module', 'your_module) . '/javascript1.js');

shipoo’s picture

Thanks a lot....It worked for me...:)