在URL上设置时间戳
生活随笔
收集整理的這篇文章主要介紹了
在URL上设置时间戳
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
//獲取當(dāng)前的毫秒數(shù)
var timestamp =new Date().getTime();function ntimestamp() {return 't=' + new Date().getTime();
}//在URL上設(shè)置時(shí)間戳
function setUrlStamp(url) {if(url.indexOf("?") != -1) {url = url + "&" + ntimestamp();} else {url = url + "?" + ntimestamp();}return url;
}
調(diào)用:
? ?location.href=setUrlStamp("weightInput.html");
轉(zhuǎn)載于:https://www.cnblogs.com/rockyan/p/8549627.html
總結(jié)
以上是生活随笔為你收集整理的在URL上设置时间戳的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 面向对象和面向过程,python中的类c
- 下一篇: Python 创建随机mac地址(单播、