js 给url添加时间戳

js 给url添加时间戳 骗过浏览器缓存

function convertURL(url){
  var timstamp = (new date).valueOf();
  if (url.indexOf("?")>=0){
     url = url + "&t=" + timstamp; 
  }else {
     url = url + "?t=" + timstamp;
  };
  return url;
};




你可能感兴趣的:(WEB)