0
我想在包含在我的主要.html文件中的单独的.js文件中使用Jquery。在单独的.js文件中的jquery
主要HTML:
<script src="myscript.js"></script>
myscript.js
function includeJS(jsPath){
var js = document.createElement("script");
js.setAttribute("type", "text/javascript");
js.setAttribute("src", jsPath);
document.getElementsByTagName("head")[0].appendChild(js);
}
includeJS("Libraries/jquery.min.js");
这是我从浏览器 未捕获的SyntaxError得到了错误:意外的令牌非法的(在jquery.min.js文件中)
而且这个jquery文件可以正常工作