How to Disable the Browser Back Button | Coding Cluster - using asp.net, c#, mvc 4, iphone, php, ios, javascript, in asp.net mvc 3 & more
 

How to Disable the Browser Back Button

Saturday

Disable Browser Back Button Using Javascript:

Just put this JavaScript on the html section to disable browser's back button.(avoid user going to previous page by clicking on back button of browser).

The scripts work all major browsers like IE,FF.Chrome
Code:

<script language="javascript" type="text/javascript">

        noBack2();

        function noBack2(){window.history.forward();}
        window.onload=noBack2;
        window.onpageshow=function(evt){if(evt.persisted)noBack2();}
        window.onunload=function(){void(0);}

</script>


0 comments:

Post a Comment

Share your thoughts here...

 
 
 

RECENT POSTS

Boost

 
Blogger Widgets