Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicate browser "Stop" button with JavaScript? 1

Status
Not open for further replies.

davidl

Technical User
Sep 20, 2000
4
IN
Is there a way to duplicate the browser's "Stop" button with JavaScript?

I need to stop loading the rest of the current page when users click on a particular image on the page.

Any hints (JavaScript or otherwise) would be greatly appreciated. [sig][/sig]
 
This can be done in JavaScript but as far as I know it has to be done in different ways to accomodate Netscape vs IE.

In Netscape you simply use the command window.stop().

I think IE will return an error from this command. At the very least it will not work. With IE, you have to use the command document.execCommand('Stop') instead.

You'll probably have to build in a browser check to make it work for everyone.

Hope this helps! [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top