neonep
Programmer
- Jun 26, 2003
- 34
Hi everyone,
I have a div on a page that I display as a popup ( it's NOT an external popup, just something inside the page that is shown or hidden as a popup ) when a button is clicked. I need to display the same div when a person tries exiting the page. Let's say someone types a new URL and hits enter on the browser address bar, I display the div using onBeforeUnload property but the page keeps on loading and the user is redirected to the new URL. I need to stop the browser from loading the URL until they click a button on the popup. Is there anyway I can do this?
I tried window.stop() in firefox but it doesn't stop the load and the reason seems to be as described at "Because of the order in which scripts are loaded, the stop() method cannot stop the document in which it is contained from loading, but it will stop the loading of large images, new windows, and other objects whose loading is deferred."
Any suggestions would be greatly appreciated.
Thank You in advance.
I have a div on a page that I display as a popup ( it's NOT an external popup, just something inside the page that is shown or hidden as a popup ) when a button is clicked. I need to display the same div when a person tries exiting the page. Let's say someone types a new URL and hits enter on the browser address bar, I display the div using onBeforeUnload property but the page keeps on loading and the user is redirected to the new URL. I need to stop the browser from loading the URL until they click a button on the popup. Is there anyway I can do this?
I tried window.stop() in firefox but it doesn't stop the load and the reason seems to be as described at "Because of the order in which scripts are loaded, the stop() method cannot stop the document in which it is contained from loading, but it will stop the loading of large images, new windows, and other objects whose loading is deferred."
Any suggestions would be greatly appreciated.
Thank You in advance.