i want to access browser previous or next button using jQuery.When i click browser previous button i want to see alert(“yes”); or any response.is it possible?
i want to access browser previous or next button using jQuery.When i click browser
Share
Yes. It is (somehow) possible in HTML5. It does not require jQuery. Use
onpopstatefor that.MDN: https://developer.mozilla.org/en/DOM/window.onpopstate
But in order to use
onpopstate, you will have to usepushStatefirst.DEMO: http://jsfiddle.net/DerekL/LZCj7/show
PS: it is originally made for AJAX applications.
Alternative method: