Friday 6 December 2013

Disable back button of your browser using javascript(Cross browser compatible)


It is an interesting browser hack and which uses hash values to prevent the default functionality of browser back button.But it and can be very annoying to use in your website and may be your user can dump your website . So please don't use that until if you have a really valid reason for it.

just at the top of your script .It set the hash value to 'no-back-button' at the time of page load.
window.location.hash="no-back-button";