Is there a way to replace the ENTIRE contents of an iframe using Javascript (or Jquery)?
For example if my iframe had the following content...
blah o
I am having the same issue, and if i use the code like this:
$(youriframe).contents().find('html').html('your content here');
It works fine in Chrome or FireFox, but in IE8, nothing will be showed or the scroll bar in iframe won't appear.
If i use Rachel's method, the iframe content will be like this in all browsers:
is there any other solution?
Tried this one:
var doc = document.getElementById(iframeId).contentWindow.document;
doc.open();
doc.write(iframeContent);
doc.close();
this works on my case, both ie8 and FF/chrome.