简体   繁体   中英

Using Head.js from an external JS file to load resources

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:

从* foo.js *调用函数后发生错误

Am I doing something in an incorrect way?

您需要包括head.load.min.js ,而不是head.core.min.js才能使用head.load函数。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM