动态加载js代码
程序员文章站
2022-04-14 10:29:52
动态加载js代码
function loadscirpt(src, fn, coding) {
var script = document.createelement('scrip...
动态加载js代码
function loadscirpt(src, fn, coding) { var script = document.createelement('script') script.async = false coding && script.charset = 'utf-8' script.type = 'type/javascript' script.readystate script.onreadystatechange = function() { ('loaded' == script.readystate || 'complete' == script.readystate) && (script.onreadystatechange = null, fn && fn()) : script.onload = function() { fn && fn() } script.src = src document.body.appendchild(script) } }
上一篇: dm3730 xload启动过程略解
下一篇: [C++]右值引用和转移语义