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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop Method

Status
Not open for further replies.

jliz2803

IS-IT--Management
Mar 21, 2005
45
CA
Sorry to keep bothering you but is there some type of universal stop method. I tried window.stop() and it did stop the page, but then I got an error message letting me know that this method was not supported. Any ideas?
 
Not that I am aware of. You can break; out of for...next loops etc; and you can return from functions -- but I don't know a way to do something like the php exit; command.

It depends where you need to stop... you may be able to use one of the techniques above.

You could define a global variable and set/test for it at critical parts of your script... and then act accordingly.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
With IE, you can issue an execCommand statement with the "stop" command, I believe. I do not know if there are methods to do this in any other browser, however, as I'm sure that the stop method has been deprecated.

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
>I tried window.stop() and it did stop the page, but then I got an error message letting me know that this method was not supported.
For ie, you can do it for instance with frame element by execCommand("stop"). For ff/nn, window.stop() usually should do. Hence, something like this for iframe.
[tt]
if (document.all) {
document.getElementById("iframe_id").document.execcommand("stop");
} else {
window.stop();
}
[/tt]
Universal? don't know.
 
Correction (typo)
The corresponding line should read like this.
[tt] document.getElementById("iframe_id").document.exec[red]C[/red]ommand("stop");[/tt]
- tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top