简体   繁体   中英

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. 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.

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.

There is an answer available here , which proposes a way of preventing users going back through the browser's back button.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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