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

php: nested if in select tag

Find pair of n numbers in php

yii2 arrayhelper::map vs array_map