怎样让前端界面自动清理js,css文件的缓存
2个回答
展开全部
<!DOCTYPE html>
<html>
<head>
<script>
var script = document.createElement('script')
script.src = 'https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js?version=' + (new Date).getTime()
var stylesheet = document.createElement('link')
stylesheet.rel = 'stylesheet'
stylesheet.href = 'https://cdn.bootcss.com/bootstrap/4.0.0-beta.3/css/bootstrap.css?version=' + (new Date).getTime()
document.head.appendChild(script)
document.head.appendChild(stylesheet)
</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script>
script.onload = function(e) {
alert(jQuery)
}
</script>
</body>
</html>
我写了一个很简单的实例。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询