scapegoat17
scapegoat17

Reputation: 5841

Drupal 7 Add jQuery File to all pages

I have looked into drupal's main page here: https://drupal.org/node/171213, but am still getting an error.

In my .info file I added the code:

stylesheets[all][] = template.css
scripts[] = megamenu.js

I understand that the style sheet is not needed. I just put it in there for reference to how it looks in my code.

I checked in my Google Chrome Web-Dev settings and it isnt even loading a the .js page, which leads me to believe that I did something wrong in the .info file. Does anyone have any ideas on where I went wrong?

Thanks!

Upvotes: 0

Views: 83

Answers (2)

Ranjeet SIngh
Ranjeet SIngh

Reputation: 673

$form['#attached']['js'] = array(drupal_get_path('module', 'billing') . '/billing.js' => array( 'type' => 'file', ));

Upvotes: 0

Kelly J Andrews
Kelly J Andrews

Reputation: 5111

Per my comment above, clearing the theme cache fixes the issue.

Upvotes: 2

Related Questions