HTML5 reload page when moving back

馋奶兔 提交于 2019-12-04 21:33:32

The right solution would be setting up the URL you'd like to refer the user to.

If this is not possible for you, and answering your question, you can try redirecting the user to the referrer page using location.href:

location.href = document.referrer;

This will redirect the user to the page they came from, and the browser won't try to restore the previous state of the page.

Maybe try Window.history.back() rather than just history.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!