欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

使用 js 添加脚本标记

最编程 2024-03-04 15:58:04
...
var secScript = document.createElement("script"); secScript.setAttribute("type", "text/javascript"); secScript.setAttribute("src", "https://xxx.xxxxxx.com/xxxxxxxx.js"); document.body.insertBefore(secScript, document.body.lastChild);