Charlie McShane Charlie McShane - 2 months ago 27
HTML Question

SCRIPT5009: '$' is undefined for IE only - jQuery is already installed

Trying to build a heatmap on Google Maps via Yeoman. It works totally fine in all other browsers apart from IE. Does not function in IE 10 all the way to Edge. Edge doesn't throw an error, but it doesn't work.

Error is the standard '$' is undefined:

SCRIPT5009: '$' is undefined


I have jQuery installed into the
<head>
and alongside the scripts at the bottom just incase there are any scripts running before jQuery, but I'm having no luck what-so-ever. Any ideas why?

URL: http://dmhost.co.uk/zoetis/googlemap/index.html

Answer

Solved

Basically, I'm an idiot. I was placing the jquery script inside this section of the head tag:

<!-- build:js scripts/vendor/modernizr.js -->
<script src="/bower_components/modernizr/modernizr.js"></script>
<!-- endbuild -->

This means the jquery was being removed during the 'gulp-build' process.

Sorry for the time-wasting here guys! Charlie