Hi,
We develop internal .jsp system for our client. We have disabled the browser back button to reduce bugs.
Now we want to send history back through only my button when we need.
My requirment is diable the "Browser Back Button" and create "Back Button" to go History -1.
I could disable "Browser Back Button"

<script language="javaScript">
function noBack() {
window.history.forward();

window.onunload = function() {
null;
};
setTimeout("noBack()", 0);
}
</script>
<body onload="noBack();" >



And I could send user history -1 through bellow function.
<script language="javaScript">
function goBack()
{
window.history.go(-1);
}
</script>
<input type="button" onclick="goBack()" value="Go Back" />



My Problem is function goBack() will be disable because of function noBack().
Now I need to run function goBack() and stop noBack() when I click the button.

So I write condition like bellow. It doesn't work.


<script language="javaScript">
//THIS IS BROWSER HISTORY BACK BLOCK - working fine
var allowBack = false;
function noBack() {
window.history.forward();

window.onunload = function() {
null;
};
setTimeout("noBack()", 0);
}

// GO BACK BUTTON FUNCTION
function goBack()
{
checkBack2();
noBack() == false;
allowBack = true;
window.history.go(-1);
return false;
}

//BODY ONLOAD CHECK THE FUNCTION WHETHER GO BACK OR STAY THE PAGE
function checkBack2(){
if(allowBack)
{
return goBack();
}
else
{
return noBack();
}
}
onclick="return goBack()"
</script>

<body onload="checkBack2();" >