Hi All,
I want to run a HIDDEN FUNCTION when I click "OK"...not "CANCEL" in window.onbeforeunload() is it possible?
<script type="text/javascript">
window.onbeforeunload = function()
{
var bUnsavedFields = true;
if(bUnsavedFields)
{
window.event.returnValue = "I WANT THE OK BUTTON NOT CANCEL :) TO TRIGGER HIDDEN FUNCTION AFTER EXIT";
}
setTimeout("myFunction();",5000);
}
function myFunction(){
alert ("hello");
}
</script>