TLDR: Is it ok to load app.js in the head and then call (document).foundation(); in the footer (even though that's calling (document).foundation(); twice?)
So the foundation zurb stack bundles jquery into app.js, which I load at the foot of every page using layout templates.
Problem is, another shop library that I’m using on a few pages includes lots of references to $ in the page because it expects jquery to be loaded in the head.
- If I load jQuery in the head then I get 2 versions of jQuery that conflict and I get errors.
- If I load only app.js in the foot as normal then I get errors in the page because the shop can’t find jQuery.
I can’t edit the shop library js or use a different library.
The solution I’ve come up with is to load App.js in the head on those specific pages (instead of the foot), and then call (document).foundation(); in the foot. This means that (document).foundation(); is getting called twice, once in app.js and once in the footer. Is this an issue?