1、history
history.go(x),// 负数后退,正数前进,0刷新,但皆不会重新请求;还可为url
history.forward() // 前进1,等效go(1)
history.back() // 后退1,等效go(-1)
返回并刷新需用location
location.href = document.referrer
2、location
location.href = url ; // 跳转
location.assign(url); // 等效href = url
location.replace(url); // 跳转并清空 history
location.reload(); // 刷新并重新请求
3、有iframe的情况
iframe的src改变会记录在父页面history,
// 不记录history
document.getElementById("iframe").contentWindow.location.replace(url)
// 记录history
document.getElementById("iframe").src = url