Is there a location where I can drop in a custom JavaScript file in Drupal 7.x?
It just includes simple event actions for menus, and I don't want to edit the theme/module files.
Or do I have to just add the "include" hook to the theme/module?
Is there a location where I can drop in a custom JavaScript file in Drupal 7.x? It just includes simple event actions for menus, and I don't want to edit the theme/module files. Or do I have to just add the "include" hook to the theme/module? |
||||
|
There's three places where you can put your Javascript resources:
You can do all of this using the drupal_add_js() function. Here are some examples of how to add a JS file from a module:
|
|||||||||||||
|
Drupal 7 allows |
||||
|
The easiest way is in your theme .info file. You just need to add scripts[] = myscript.js in to the .info file of the theme you are using. |
|||
|