Working on a product page using Expresso Store and I'm encountering an intermittent javascript error:
Uncaught TypeError: undefined is not a function - store.js:142
It looks like a dependency problem (store.js depends on jQuery). The store.js is being added to the page asynchronously in the footer of the {exp:store:product}
tag whereas jQuery is added to the page at the bottom of the page, just before the </body>
. Depending on network performance and what is cached in the browser, occasionally the store.js loads before jQuery has loaded.
I dont want to move jQuery to the page header, so is there a way to specify where Expresso injects its JS (eg: a special JS template tag) or is there a way to force the store.js script tag to be synchronous and hence enforce the script loading order?