This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi all, I have a question whe a user tries to go to a different page I am checking for some condition and if condition is true I am allowing him to move to next page otherwise same page will be displayed. This i m doing in onUnload handler, but if condition is false i want to stop unloading of current page . How do do this?? i tried window.stop(); and document.execCommand('stop'); but it did't worked. thanks for ur time. Anurag
You can do it on IE only using onbeforeunload handler. There is no way to do it using onunload. Best you can do, is to call alert, so the page will stay until user hits "OK".
Joined: Jun 16, 2003
Hi Yuri, thanks a lot for your reply but onbeforeunload displays its own message I know we can customize this message but we cannot customize it totally as if we use this we need to display Microsoft's messages also. pls put your comments. thanks anurag
Joined: Nov 08, 2001
you are stuck with what you got, I would use a different approach where you send the links to a function and check it that way. If it is true then let them advance by changing the link
This wil not stop yping into the Addy bar or closing the browser or the forward buttons Eric