This answer tells how to stop redirection:
<script language="JavaScript" type="text/javascript">
//<![CDATA[
window.onbeforeunload = function(){
return 'Are you sure you want to leave?';
};
//]]>
</script>
This codes works, but asks an user whether to stay on the page or redirect. Can the redirect be stopped without any type of alert or asking?