页面跳转

The Window.location read-only property returns a Location object with information about the current location of the document.

直接跳转

1
window.location.href='href'

新页面跳转

1
window.open('href')

返回上一页(不刷新)

1
2
window.history.go(-1)
window.history.back()

返回上一页(刷新)

1
window.location.go(-1)

返回前N步

1
window.history.go(-N)

刷新页面

1
2
3
window.location.reload()
window.history.go(0)
document.execCommand(''Refresh'')

新页面打开

1
window.open('href')

无刷新修改URL参数

1
window.history.pushState(null, null, href)