动态加载js文件

如果不需要浏览器做缓存,可以试一下在header里写一些信息(具体没试过,网上找的)

<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Cache" content="no-cache">

动态加载js文件,在js资源url后加随机数

<script>
    document.write("<script type='text/javascript' src='js/test.js? "+ Math.random(); +"'></script>");
</script>
原文地址:https://www.cnblogs.com/Liang-Haishan216/p/7797712.html