I have a simple code that first loads jQuery then a script that uses the $ syntax. But I always get
ReferenceError: $ is not defined
First I thought it was because the async attribute on the script tag was set to async, but it doesn't make a difference.
Html:
<script async="false" crossorigin="anonymous" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" src="https://code.jquery.com/jquery-3.4.1.js" type="application/JAVASCRIPT"></script>
<script async="async" src="/SCRIPT/Creator/Creator.js" type="application/JAVASCRIPT"></script>
Creator.js:
$(document).ready(() => {
function CloseModalBackground() {
....
}
});
//# sourceMappingURL=Creator.js.map
Live snippet demonstrating the problem:
<script async="false" crossorigin="anonymous" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" src="https://code.jquery.com/jquery-3.4.1.js" type="application/JAVASCRIPT"></script>
<script>
// jQuery *should* be defined by now, right But no:
console.log(typeof $);
</script>