PDA

Click to See Complete Forum and Search --> : Preventing a browser window/page from closing


subbupr
Feb 14th, 2001, 11:16 AM
Hi Guys,

How do u do this?
I'v got a page loaded and showing. When I'm closing
the window or moving to another page, I should
check for some values and based on the values
the page should not be unloaded or the window
should not be closed.

I want a functionality similar to the queryunload event
in VB where u can prevent a form from closing if
u return a value to the CANCEL parameter.

Can u guys help me out with this ?

Feb 14th, 2001, 01:38 PM
You could open a new instance of your window when the person closes IE or navigates to another site.


<body onUnload="window.open(window.location)">

subbupr
Feb 14th, 2001, 01:48 PM
Ok buddy. Thank u.
But can't u prevent the window/page from closing
rather than reloading it again because i'v got a lot
of values to be populated on that page ?