javascript - 在一个js文件中调用所有jquery文件
问题描述
要在我当前使用的标题上的一行中调用所有 js 文件
function alljs(jsfile) {
var src = document.createElement("script");
src.setAttribute("type", "text/javascript");
src.setAttribute("src", jsfile);
document.getElementsByTagName("head")[0].appendChild(src);
}
alljs("path/to/my/jsfile1.js");
alljs("path/to/my/jsfile2.js");
alljs("path/to/my/jsfile3.js");
那么我所要做的就是把它放在我的标题上:
<script type="text/javascript" src="my/path/all.js" ></script>
但最近我必须在我的系统中包含 jquery 文件我注意到通过添加调用 jquery 文件
alljs("path/to/my/jqueryfile1.js");
到我的all.js文件不起作用...我必须<script>
在标题上做第二行才能调用 jquery 文件...
我的问题是:是否有类似的方法可以在一个文件中调用所有 jquery 文件?
解决方案
推荐阅读
- javascript - JavaScript 识别这是否是一个有效的 JS 类?
- python - 如何检查字符串是否包含在列表中以及输入的答案是否在我的附加列表中?
- powerbi-paginated-reports - Milti 分页报告给多个用户
- fragment - 如何通过按后退按钮检查它是否到达上一个片段
- python - Python - 用于导入 KMZ/KML 文件和通过坐标和高度的路径构建矩阵的库/API
- ios - 使用 UIBezierPath 绘制的双曲线
- google-chrome - 有没有办法绕过 Chrome 浏览器上的 WebHid USB 限制?
- node.js - 我在更新目标文章时遇到错误
- php - 使用 WooCommerce REST API 创建自定义仪表板时出错
- java - 原因:java.security.NoSuchAlgorithmException:找不到任何支持 ECIESwithAES 的提供程序