location.replace和location.href区别

有三个页面 a b c
页面跳转顺序为 a -> b -> c
1.b -> c 是通过 window.location.replace 点击回退按钮时 回到a页面
2.b -> c 是通过 window.location.href 点击回退按钮时 回到b页面
区别:点击回退按钮时 页面不同

发布了34 篇原创文章 · 获赞 23 · 访问量 7578

猜你喜欢

转载自blog.csdn.net/qq_37330613/article/details/103499952