Thursday, January 20, 2011

Disable Back Button in Browser

Dear Googler,
          In this i explain how to disable back button in browser. It is very important for secure web application and website. Here we are using small piece of  javascript code to do this.

In the Script block just type the below code.



<Script>
function disableBackButton()
{
    Window.history.forward();
}
SetTimeout("disableBackButton()",0);
</Script>

And then onload event you call the disableBackButton() function.

<body onload="disableBackButton()">

1 comment: