给url地址增加时间戳, 骗过浏览器, 阻止浏览器读取缓存
function convertURL(url){
var timestamp = (new Date()).valueOf();
if(url.indexOf("?")>=0){
url = url + "&t=" + timestamp;
}else{
url = url + "?t=" + timestamp;
}
return url;
}
给url地址增加时间戳, 骗过浏览器, 阻止浏览器读取缓存
function convertURL(url){
var timestamp = (new Date()).valueOf();
if(url.indexOf("?")>=0){
url = url + "&t=" + timestamp;
}else{
url = url + "?t=" + timestamp;
}
return url;
}
转载于:https://my.oschina.net/chinamummy29/blog/285473