Click to See Complete Forum and Search --> : window.onbeforeunload stop unloading


mayannajeeb
11-12-2006, 11:10 PM
Hi all,

I have an html page ,I want to stop unloading this page .. for this i used
<script language="javascript">
window.onbeforeunload=confirm;
function confirm(){
event.returnValue = "Closing forms application. OK to continue?";
}
</script>

This works fine but i have a problem this popus up an alert everytime it refreshes ,i want to stop unloading the page and i dont want any message to be displayed at the client side.

Please Helpe me to resolve this.

Kor
11-13-2006, 09:51 AM
Unfortunately, from the browser's point of view there is no difference between closing the page on refresh and closing the page on quit. onbeforeunload will simply capture the closing of the session, no matter the reason. There is nothing you can do about.

mayannajeeb
11-13-2006, 11:15 PM
Can u just give me an idea that how tho stop hijakking my internet explorer window without any notification to the user.

Am a novice to scripting ,can you plese suggest some techniques.