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.
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.
>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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.