How to disable back button of browser?

By using java script it can be done

<script language="JavaScript">javascript:window.history.forward(1);</script>

Or

<A HREF="PageName.htm" onclick="javascript:location.replace(this.href); event.returnValue=false; ">No back button when you do this.</A>

Or

<html><head><title>Back Button Demo: Page One</title>
<script>
function backButtonOverride()
{  setTimeout("backButtonOverrideBody()", 1);  }
function backButtonOverrideBody()
{ try { history.forward(); } catch (e) { }
setTimeout("backButtonOverrideBody()", 500);
}
</script></head><body onLoad="backButtonOverride()">
<h1>Back Button Demo: Page One</h1><a href="page2.html">Advance to Page Two</a>
</body></html>

Tagged , . Bookmark the permalink.

One Response to How to disable back button of browser?

  1. jawahar says:

    nice article, can u please explain Delegate in java script

Leave a Reply