can I check what site window.history.back() will bring the user to?

流过昼夜 提交于 2019-12-02 01:51:32

You can however check how you arrived at the current page by using 2 methods:

document.referrer, but that only works if the user didn't block that, and gives you some limited info. A more robust method might be to set some information about the previous page in either the URL, or in a SESSION variable.

No.

For security reasons the History object doesn't allow the non-privileged code to access the URLs of other pages in the session history, but it does allow it to navigate the session history.

Documentation

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