You need to include head.load.min.js
, not head.core.min.js
to use the head.load
function.
Using Head.js from an external JS file to load resources
-
08-10-2022 - |
Question
I have an HTML file which includes a JS file in the head tag..
<script type='text/javascript' src='lib/head.core.min.js'></script>
<script type='text/javascript' src='custom/my.js'></script>
In the my.js file I try to load another JS file to use in my.js:
head.load("custom/foo.js");
But anytime I try to execute a function from foo.js I get the following error:
Am I doing something in an incorrect way?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow