Setting HTML of window.open() producing strange styling issues in Internet Explorer
<p>So I have some javascript that opens a new window with no target URL. I then want to set the HTML contents of that window to be the contents of a variable, a long string of valid HTML. </p>

<pre><code>var myHtmlHead = "&lt;link href='/foo/my.css'...";
var myHtmlBody = "&lt;div id='foo'&gt;...'";
var myWindow= window.open("", "MyWindow","height=500,width=500");

myWindow.document.head.innerHTML = myHtmlHead;
myWindow.document.body.innerHTML = myHtmlBody;
</code></pre>

<p>I've cut out the content for readability. The issue is that while this works perfectly in Chrome and Firefox, IE throws up a number of strange styling issues; the CSS loads but all of the DIV's are centered and overlapping and as soon as I resize the window even an pixel, it corrects itself. I think this is down to the fact that I'm loading the CSS after the window has been loaded and its not applying it correctly until the window needs to be redrawn. </p>

<p>Is there a way to get around this issue, or to trigger the redrawing programatically from the parent page's JS?</p>

<p>Edit: IE version is 11.0.9600, though it seems to work fine with Chrome 49 for example. </p>