There are a few cases where I need to solve a problem by pushing content into an iframe from the outside page. Most of the time this is not possible given the browser security around iframes, and I've had a lot of trouble getting stuff in there using data urls.
More recently I've discovered contentWindow:
var iframe = document.getElementById('myIframe');
iframe = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument;
iframe.document.write('<body><script src="http://anything/you/want.js"></script><h1>Any html content or script tags</h1></body>');
...which can be used to dynamically push content into an iframe. It seems to work pretty well in all situations, so I'm just wondering if there's some major drawback of this method which I haven't seen yet, or is it not very widespread simply because it doesn't work in ie8? It seems too good to be true...