So i have iframe and i\'m uploading files through it, so my question is how can i stop it in the middle of the loading? I\'ve tried to change src with jquery function attr
I believe the following answers your question: https://stackoverflow.com/a/2207589/1157493
For FireFox/Safari/Chrome you can use window.stop():
window.frames[0].stop()
For IE, you can do the same thing with document.execCommand('Stop'):
window.frames[0].document.execCommand('Stop')
For a cross-browser solution you could use:
if (navigator.appName == 'Microsoft Internet Explorer') { window.frames[0].document.execCommand('Stop'); } else { window.frames[0].stop(); }
If you'd like the iframe to go to a different page you could try to redirect it to "about:blank"
This works for me (IE, Chrome, FF, Opera):
$iframe.attr('src','about:blank');
can use this for disabling all iframe content
<script>
var frames = window.frames;
var i;
for (i = 0; i < frames.length; i++) {
frames[i].location = "";
}
</script>