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

Object Oriented Concepts in PHP5

yii2 arrayhelper::map vs array_map

create pdf by using javascript