📜  javascript 以编程方式在头部添加脚本 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:44.748000             🧑  作者: Mango

代码示例1
var my_awesome_script = document.createElement('script');

my_awesome_script.setAttribute('src','http://example.com/site.js');

document.head.appendChild(my_awesome_script);