I need to catch the Android back button event using simple Javascript (if possible),
I have a mobile site on which I want to warn the user and close the entire site when I click the "Back" button in any part of my site, I do not need to navigate my history
Note. I do not want to include Phonegap support on my site.
Any ideas would be great!
Edit: I also used
window.onbeforeunload = function() { return "Do you want to exit?"; };
This also does not help in my situation, because it will be called when the URL is uploaded, I move the page to the page using the div using #ID ( using Jquery Mobile <div data-role="page"></div> )
Thus, I strictly want to receive the event by pressing the Android Back button
source share