标签:style blog http color io ar sp div on
将<script>标签绑定到<html>上, html可换成body,header等其他存在的标签。
var htmm =document.getElementsByTagName("html")[0]; var scri = document.createElement("script"); scri.async="async" scri.src="http://www.xxx.com/dummy.js" scri.onload=function(){console.log("script onloaded");} htmm.appendChild(scri); Result: <script async src=?"http:?/?/www.xxx.com/?dummy.js">?</script>? dummy.js dummy.js:1 script onloaded
标签:style blog http color io ar sp div on
原文地址:http://www.cnblogs.com/zzSoftware/p/4047473.html