Skip to content Skip to sidebar Skip to footer

Iframe Doesn't Stop To Loading

As answered in this post, I'm trying to set an Iframe's content with : document.getElementById('iframe').contentDocument.write('Test123'); The problem is that even though everyth

Solution 1:

You need to close the iframe connection:

document.getElementById("iframe").contentDocument.close();

I think that this will work.

Solution 2:

Try doing it with jQuery, it might solve your issue and it is much cleaner:

$("#iframe").contents().find("html").html("Test123")

Post a Comment for "Iframe Doesn't Stop To Loading"