This question already has an answer here:
My code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://someothersite.com/external.js"></script>
external.js:
$("head").append(unescape(""));
Unfortunately I am getting the following error when I include my external script:
Uncaught TypeError: $ is not a function
How do I fix this? Please bear in mind I can't edit the external Javascript file as it's third party.
I think the issue was because the external javascript was loaded first before the jquery was loaded. To solve this use requirejs, follow this link for the usage http://requirejs.org/docs/api.html
Use the following statement in a JS file.
After declaring the above statement you will be able to use $ sign.
It was using an old version of jQuery.
I updated the version and this resolved the issue for me.
Woop!