添加js文件和删除js
onloadJS: function (url, callback) {
let script = document.createElement('script')
script.src = url
script.type = 'text/javascript'
document.getElementsByTagName('head')[0].appendChild(script)
script.onload = callback
},
removeJS: function (url) {
let scripts = document.getElementsByTagName('script')
for (let bb of scripts) {
if (bb.src.indexOf(url) > -1) {
document.getElementsByTagName('head')[0].removeChild(bb)
}
}
}