window.stop()

JavaScript1.2+, JScript3.0 Nav4+, IE4+ Syntax

							window.stop()

Description

The stop() method of the Window object simulates the user clicking the Stop button on the browser. It stops the browser from downloading and rendering the current page.

Example

Listing 7.587 has a button and an image reference to a nonexistent image. The browser will continue to try and download the image until it times out or the download is stopped. Clicking the button will stop the download.

Listing 7.587 Using the stop() Method to Stop a Page from Loading
 <html> <body> <form> <input type=BUTTON value="Stop" onClick="window.stop()"> </form> <p> <table border=1color= bgcolor="#FF0000"><tr><td> <img src="http://www.purejavascript.com/images/fake.gif" ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.