动态添加script标签,并防止缓存添加时间戳
时间:2020-05-18 16:19:05
收藏:0
阅读:322
<script>
window.onload = function () {
var el = document.createElement(‘script‘)
var el_html = document.querySelector(‘html‘)
var timetemp = new Date().getTime()
el.type = ‘text/javascript‘
el.src = ‘./index.js?timetemp=‘ + timetemp
el_html.appendChild(el)
}
</script>
原文:https://www.cnblogs.com/sq652366/p/12911065.html
评论(0)