How to redirect a page to another page when refresh at second attempt
问题 <script language="JavaScript"> window.onbeforeunload = confirmExit; function confirmExit() { alert("");window.location="index.html"; } </script> Here i tried but not working please guide me 回答1: In bbb.jsp : window.onbeforeunload = function() { window.setTimeout(function () { window.location = 'AAA.jsp'; }, 0); window.onbeforeunload = null; // necessary to prevent infinite loop, that kills your browser } 回答2: Windows onload loads after all the content is loaded, little bit slow other