Hi all !!!

i m trying to add some javascript code to my additional module in ecommerce module.my problem is that i dont know how to add .js file in the head .My code works when i use drupal_set_html_head() function.but how m i suppose to put the file source in it.I can see the javascript code appended in the head if i pass it to that function.but the path of the file seems not to be correct.

Pleaze help me to specify the correct path of the product_type.js file located in ........

/drupal/modules/ecommerce/product_type/

product_type is the module i m trying to create in ecommerce subdirectory.

Basically my question is that wat should i give as src=" " in script tags for the above file path.Or if there is some other method to do wat i want.

Thanx
Rituka

Comments

budda’s picture

I achieved something similar using the drupal_get_path() function.

$jscript_path = url(drupal_get_path('module', 'tinymce').'/tinymce/jscripts/tiny_mce/tiny_mce_popup.js', NULL, NULL, TRUE);

--
www.bargainspy.co.uk