Can you do that with Drupal? Do you need to add a module?

Comments

alan d.’s picture

Depends a bit on your drupal version:

All version, add it or the link to the script directly into your themes page.tpl.php file.

Add it via a function call from your themes template.php, or almost any location / function. See the api for details. drupal_add_js


Alan Davison
www.caignwebs.com.au

Alan Davison
mgt’s picture

i have Drupal ver 6.x...noticed your link referred to 5.x...is there a link for 6.x?

mattyoung’s picture

is to do it with your theme:

a) create your js file, say 'my-javascript.js'
b) modify your theme's .info file and add the line:

scripts[] = my-javascript.js

Note: whenever you modify theme's .info, you need to reset the theme registry for it to take effect.