Online Shopping : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to
Did You Find This Entry Useful?

23 of 47 people (49%) answered Yes
Recently 2 of 10 people (20%) answered Yes


How do I stop a page loading when it starts loading from the server.

Apr 7th, 2008 23:22
ha mo, Sebastien Boisvert, Abraham N.,

Assuming you don't have control of the new page that gets loaded, you 
can simply use an onunload event to stop the window from loading the 
new page when the current one gets unloaded:
<body onunload="window.stop">
If you want to submit something but don't want the baggage of the 
response, you can use this method:
<body onload='document.forms[0].submit()' onunload='window.stop'>
<!-- your form inputs -->
Both would normally result in a blank page in the client.