Microsoft KB Archive/269802

= BUG: Internet Explorer Stops Responding When You Download Images =

Article ID: 269802

Article Last Modified on 5/11/2006

-

APPLIES TO


 * Microsoft Internet Explorer (Programming) 6.0
 * Microsoft Internet Explorer 5.01
 * Microsoft Internet Explorer (Programming) 5.01 SP1
 * Microsoft Internet Explorer 5.5
 * Microsoft Windows Internet Services (WinInet)

-



This article was previously published under Q269802



SYMPTOMS
When you browse to a Web site that dynamically adds images to a page, some of those images may intermittently fail to appear. The Internet Explorer icon continues to spin for five minutes in the upper-right corner of the browser as if the browser stops responding (hangs) while it attempts to download the content. You may receive the following error message:

-2147012894 Internet Client Error: Request Timeout.



RESOLUTION
To resolve this problem, you can use one of the following methods:  Redesign the Web application to minimize dynamic addition of images to the page.  In certain cases, such as the example shown in the &quot;More Information&quot; section, you can recode the Web application to dynamically insert the  tags by using the innerHTML property without specifying the src property.

Later, such as on a timer event, the src properties can be changed dynamically to reflect the correct image URL. For example: function doLoad {   // After changing the xsl to not include the src for the image tags xslTarget.innerHTML = source.transformNode(style.XMLDocument); window.setTimeout(&quot;addImg&quot;,1); }   function addImg {       var imgs; imgs = document.body.all.tags(&quot;IMG&quot;); var srcs=source.selectNodes(&quot;//Path&quot;); var len=imgs.length; for(i=0;i Increase the maximum number of connections for each server. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

183110 INFO: WinInet limits connections per server

NOTE: This technique increases the connection load on all HTTP servers that Internet Explorer visits and globally forces Internet Explorer go against the HTTP specification. This workaround is only recommended if Internet Explorer hangs frequently, and you cannot change the code for the Web site.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
The pages that exhibit this problem differ greatly in design and technique. However, at a basic level, all pages that are known to exhibit this specific problem add images dynamically after the initial page has finished loading. These pages either change the src property of an  tag or dynamically add  tags with the innerHTML property or insertAdjacentHTML method.

The following example is a basic page that uses Extensible Markup Language (XML) and innerHTML to illustrate the code that is prone to this bug: <HTML> <BODY onload=&quot;doLoad&quot;> <SCRIPT language=&quot;JavaScript&quot;> function doLoad {       xslTarget.innerHTML = source.transformNode(style.XMLDocument); } </SCRIPT>

<XML id=&quot;source&quot;> </XML> <XML id=&quot;style&quot;> <xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/TR/WD-xsl&quot;> <xsl:template match=&quot;/&quot;> <xsl:apply-templates select=&quot;//Image&quot;/> </xsl:template> <xsl:template match=&quot;Image&quot;> <P> Some Image <img border=&quot;0&quot; width=&quot;16&quot; height=&quot;16&quot;> <xsl:attribute name=&quot;name&quot;><xsl:value-of select=&quot;Name&quot;/></xsl:attribute> <xsl:attribute name=&quot;src&quot;><xsl:value-of select=&quot;Path&quot;/></xsl:attribute> </P> </xsl:template> </xsl:stylesheet> </XML>

<DIV id=&quot;xslTarget&quot;></DIV>

</BODY> </HTML> This sample test case is reproducible and uses Extensible Stylesheet Language (XSL) to process the XML data in the XML tag. XSL transforms XML data to visible content. When you set innerHTML on the xslTarget DIV element during the window onload event for this page, an image is added to the page for every &quot;Image&quot; node in the XML data. As described earlier, this may demonstrate the problem described in this article, depending on the timing of other portions of the Web application.

<div class="references_section">