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

create pdf by using javascript

Question: Why should we use class name in another class constructor function in php7?