js 跳转的几种方法收藏

history.go(-n) 返回上一页(n 为返回前几页)

window.location.reload(); 刷新当前页面

history.go(-1);window.locatoin.reload();  等效于 self.location = document.referrer   返回上一页并刷新

window.location.href = ''; 跳转到其它页面

self.location

刷新的几种方法:

history.go(0)
location.reload()
location = location
location.assign(location)
document.execCommand('Refresh')
window.navigate(location)
location.replace(location)
document.URL = location.href

<meta http-equiv="refresh" content="10;url=http://www.baidu.com"> 10秒后跳转到百度

原文地址:https://www.cnblogs.com/wherein/p/6370084.html