Is there a way in javascript of stopping an iframe in the middle of loading a page? The reason I need to do this is I have a background iframe streaming data from a web server (via a Comet style mechanism) and I need to be able to sever the connection at will.
Any ideas welcome.
For FireFox/Safari/Chrome you can use window.stop():
For IE, you can do the same thing with document.execCommand(‘Stop’):
For a cross-browser solution you could use: