Created
April 16, 2018 08:56
-
-
Save roshanca/4a0ae8d9e4416c02208a8b099b9980af to your computer and use it in GitHub Desktop.
JavaScript 如何跳转页面
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 跳转 | |
window.location.replace('https://www.awesomes.cn') // 不将被跳转页面加入浏览器记录 | |
window.location.assign('https://www.awesomes.cn') | |
window.location.href = 'https://www.awesomes.cn' | |
window.location = 'https://www.awesomes.cn' | |
// 返回上一页 | |
window.history.back() | |
window.history.go(-1) | |
// 刷新当前页 | |
window.location.reload() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment