Reputation: 339
i am trying to add foundation.js and foundation-topbar.js version 4 to page.tpl.php via theme.info in drupal 7. i can see that jquery and foundation js files added correctly -jquery above foundation js files - but i get this errors:
TypeError: $ is undefined
(Foundation.zj, this, this.document)); // foundation-topbar.js line 206
ReferenceError: Foundation is not defined
(Foundation.zj, this, this.document)); // foundation-topbar.js line 206
Upvotes: 1
Views: 11919
Reputation: 21
The 'Foundation' that it's looking for is the class object. you'll need to include foundation.js that's in the same directory as the js libs you're using.
Upvotes: 1
Reputation: 2051
You will need to add links to the script in this order:
$
is a shorthand for jQuery calls and functions. So $('')
is the same as jQuery('')
Zepto uses $
and is jQuery compatible so it is possible that you have both loading with a conflict, but without seeing the source it is hard to tell.
Upvotes: 4