var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js";
head.appendChild(script);
https://stackoverflow.com/questions/18784920/how-to-add-dom-element-script-to-head-section
本文介绍了一种使用jQuery库动态向网页头部添加脚本元素的方法,通过获取head标签并创建script元素,设置其src属性为jQuery库地址,实现库文件的异步加载。
1224

被折叠的 条评论
为什么被折叠?



