Js中返回上一页的代码总结
history.back(-1):直接返回当前页的上一页 不刷新
history.go(-1):也是返回当前页的上一页 不刷新
window.location.replace(document.referrer) 会刷新
window.location.href=“上一个页面URL” 会刷新
博客总结了Js中返回上一页的代码。其中,history.back(-1)和history.go(-1)直接返回上一页且不刷新;window.location.replace(document.referrer)和window.location.href=“上一个页面URL”也能返回上一页,但会刷新页面。
Js中返回上一页的代码总结
history.back(-1):直接返回当前页的上一页 不刷新
history.go(-1):也是返回当前页的上一页 不刷新
window.location.replace(document.referrer) 会刷新
window.location.href=“上一个页面URL” 会刷新
3099
9225
413

被折叠的 条评论
为什么被折叠?