在onLoad函数中:
setTimeout(function () {
let linkAddress = 'http://sdk.xxxxxx.net/adv/index.js';//sdk
const _this=this
const script = document.createElement('script');
script.type = "text/javascript";
if (script.readyState) {
script.onreadystatechange = function() {
if (script.readyState == "loaded" || script.readyState == "complete") {
script.onreadystatechange = null;
_this.initAnBoAdv();//使用插件里面的方法
}
}
} else {
script.onload = function() {
_this.initAnBoAdv()//使用插件里面的方法
}
}
script.src = linkAddress;
document.body.appendChild(script);
}, 150)