reload
- reload ()方法強迫瀏覽器刷新當前頁面
- location.reload((false)---參數可選,默認為false,從緩存獲取當前頁;true則以 GET 方式,從服務器端獲取最新的頁面, 相當于點擊 F5("刷新")
replace
location.replace(URL)---指定的URL會替換緩存頁面,所以不能前進和后退
history.go(0)
location=location
location.assign(location)
document.execCommand('Refresh') //返回false
window.navigate(location) //ie下的
document.URL=location.href//返回的URL
window.location.href=URL//URL為當前頁面地址,需要跳轉則為跳轉地址
返回并刷新
- location.replace(document.referrer);
打開新窗口的兩種方式
1.window.location.href="http://www.xxx.xxx"; //在當前窗口中打開窗口
2.window.open("http://www.xxx.xxx"); //在另外新建窗口中打開窗口
頁面跳轉
- self.location='xxx.xxx';