If you want to restrict the user to go back or forward from the web browser, you can use the below mentioned javascript. Use this javascript in the script tag. It works on all browsers.
For further details:
If you want to restrict the user to go back or forward from the web browser, you can use the below mentioned javascript. Use this javascript in the script tag. It works on all browsers.
For further details:
function defeatIE()
{
if (document.all)
{
(message);return false;
}
}
function defeatNS(e)
{
if
(document.layers||(document.getElementById&&!document.all))
{
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{
document.captureEvents(Event.MOUSEDOWN);document.onmousedown=defeatNS;
}
else
{
document.onmouseup=defeatNS;document.oncontextmenu=defeatIE;
}
document.oncontextmenu=new Function("return false")
function preventBack()
{
window.history.forward();
}
setTimeout("preventBack()", 0);
window.onunload=function(){null};
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.