Iframe not loading in IE after installing update KB3154070 Iframe not loading in IE after installing update KB3154070 asp.net asp.net

Iframe not loading in IE after installing update KB3154070


@Matt's answer provides a clue on how to workaround the problem. It appears that IE, with the KB3154070 installed, blocks iframe content if the iframe initiates any scripting operations before the parent DOM tree is ready. I have noticed no blocking occurs if resource loaded by iframe contains no scripting. I have also noticed that sometimes IE will not block content with scripting, but this is likely due to a race condition between parent DOM being ready and iframe resource loading.

Another observation is I have not seen any iframe loading problems when running IE in edge mode. It appears the problem only occurs when running in compatibility mode.

To workaround the problem for the project I work on, I stubbed the iframe, where I declare no value for the src attribute. In the main page's onload handler--which indicates the DOM tree is ready--I use javascript to set the src attribute of the iframe. Doing this appears to work, where the iframe gets properly loaded.

For example, say you have the following:

<iframe id="myIFrame"></iframe>

In your onload handler, you have something like:

document.getElementById('myIFrame').src = '/whatever/url/to/load';

I still think KB3154070 introduced a regression bug (if not bugs), but maybe what I have suggested can be applied to your application.

UPDATE

IE update KB317016 appears to fix the iframe loading problem. Microsoft has officially recognized the bug: KB3176757.

I plan on keeping my changes in place since some of our customers may not be able to update IE immediately. Also, the changes made still work in all versions of IE we need to support.


We ran into exactly the same problem. The issue in our specific case was that iframes now abort their requests when they are re-parented (i.e. moved from one DOM tree location to another). We were able to work around the new restriction by avoiding moving the iframe while it was loading. I can't be certain that's exactly what's happening in your case, but I'd wager it was some interaction occurring between the start of the iframe load and its completion.


My company legacy software was hugely impacted by this issue. We came up with the following generic solution until microsoft solves this bug:

 $(document).ready(function() {    loadIframesIE(); }); function loadIframesIE() {    var $iframe;    $('iframe').each(function(cnt, iframe) {        $iframe = $(iframe);        // If the iframe body has no child, it couldn't be loaded        if ($iframe.contents().find('body').children().length === 0 && !$iframe.attr('resetted')) {            // Necessary to avoid an infinite loop in some cases            $iframe.attr('resetted', true);            $iframe.attr('src', $iframe.attr('src'));        }    }); }