<script>
(function () {
var random = Math.random();
//处理请求JS文件缓存
var element = document.getElementsByTagName("script");
for (var i = 0; i < element.length; i++) {
if (element[i].src) {
if (element[i].src.indexOf('?') > -1) {
element[i].src = element[i].src + '×treap=' + random;
} else {
element[i].src = element[i].src + '?timestreap=' + random;
}
}
};
//处理CSS文件缓存
var link = document.getElementsByTagName("link");
for (var i = 0; i < link.length; i++) {
if (link[i].href) {
link[i].href = link[i].href + '?timestreap=' + random;
}
}
})()
</script>
网友评论