Disable back button of any browser in javascript


Hi Friends
I was working on web application in which we have to disable browser back button,so search number solution in stackoverflow and found best suitable solution for it.I wanted to share that code ,so that developer can save time on searching.

history.pushState(null, null, document.URL); window.addEventListener('popstate', function () { history.pushState(null, null, document.URL); });

Comments

Popular posts from this blog

Find pair of n numbers in php

php: nested if in select tag

yii framework simple shopping cart tutorial for beginners