简体   繁体   English

浏览器后退按钮和 javascript

[英]Browser back button and javascript

It's possible to show some message on the page when you set mouse cursor on the browser back button?当您将鼠标光标设置在浏览器后退按钮上时,是否可以在页面上显示一些消息? I don't want to use window.onbeforeunload , because it's irritating.我不想使用window.onbeforeunload ,因为它很烦人。 I use ajax and I want to inform users that if they want to go back to the previous page on my web portal they should use a different button.我使用 ajax,我想通知用户,如果他们想返回到我的 Web 门户上的上一页,他们应该使用不同的按钮。

Is it possible to do it?有可能做到吗?

Thanks for your help谢谢你的帮助

It is not possible to handle the mouse moving on the browser buttons, these are not part of the DOM that your scripts can handle.无法处理鼠标在浏览器按钮上的移动,这些不是脚本可以处理的 DOM 的一部分。

There is an answer available here , which proposes a way of preventing users going back through the browser's back button.这里有一个可用答案,它提出了一种防止用户通过浏览器的后退按钮返回的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM