Stopping an Iframe From Loading

by guruprasad 2014-04-17 10:17:40

To Stop an Iframe from loading,


Function to be used:

window.frames[0].stop(); //frame[0] refers that the first frame has to be
stopped.you can specify the frame number that has to
be stopped inside the frame to stop loading.

If it is IE browser,

window.frames[0].document.execCommand('Stop');


If it is of cross-browser,

if (navigator.appName == 'Microsoft Internet Explorer') {
window.frames[0].document.execCommand('Stop');
} else {
window.frames[0].stop();
}


Note: Will be helpful in stopping the loading of iframe when there is no reponse in iframe content and its blocking the rest of file loading
1061
like
0
dislike
0
mail
flag

You must LOGIN to add comments