DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 320731 - Last Review: June 19, 2014 - Revision: 8.0

 

On This Page

Symptoms

When you dynamically add an object that contains an attached behavior to a Web page, and the behavior must be downloaded, the progress bar in Microsoft Internet Explorer continues to increase. The progress bar continues to show progress even after the behavior is downloaded, and the page is rendered. However, the attached behavior works correctly without any unexpected problems.

Cause

This issue may occur when Every visit to the page is selected for the Check for newer versions of stored pages option in Internet Explorer.

To view the Check for newer versions of stored pages option, follow these steps:
  1. In Internet Explorer, click Tools, and then click Internet Options.
  2. On the General tab, click Settings under Temporary Internet files.
  3. In the Settings dialog box, view the Check for newer versions of stored pages option.

Workaround

To work around this issue, take either of the following actions:
  • Avoid dynamically inserting any objects that contain attached behaviors.
  • Set the message text in the status bar of Internet Explorer after you add the object.

NOTE: This issue may not be isolated to behaviors only. You may experience a problem with any element that must be downloaded, such as an image.


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

More information

This issue occurs if you dynamically add an attached behavior by replacing the inner HTML of an element, such as the DIV element, by using the createElement method or the insertAdjacentHTML method, or by dynamically changing the className property of an element.

Steps to reproduce the behavior

  1. Copy the following code sample, and then save the code sample to a file that is named Test.htm.
    <HTML>
        <HEAD>
            <STYLE>
                .UseBehavior
                {
                    behavior: url(behavior.htc);
                }
            </STYLE>
    
            <SCRIPT>
                function DoClick()
                {
                    SetTarget.innerHTML = "<DIV CLASS='UseBehavior'>Hello World</DIV>";
    		//Uncomment the following line to work around the problem.
                    //window.status="Finished";	
                }
            </SCRIPT>
        </HEAD>
    
        <BODY>
            <DIV ID="SetTarget">Click to try the test</DIV><BR>
            <BUTTON onClick="DoClick()">Click to insert the attached behavior.</BUTTON>
        </BODY>
    </HTML>
    					
  2. Copy the following code sample, and then save the code sample to a file that is named Behavior.htc. Put the Behavior.htc file in the same directory where the Test.htm file is located.
    <PUBLIC:COMPONENT>
    <PUBLIC:ATTACH EVENT="ondocumentready" ONEVENT="Element_DocumentReady()" />
    
    <SCRIPT language="JScript">
    function Element_DocumentReady()
    {
    	// This is almost an empty behavior.
    }
    </SCRIPT>
    </PUBLIC:COMPONENT>
    					
  3. Open the Test.htm file, and then click Click to insert attached behavior.
After the text changes from "Click to try the test" to "Hello World", the behavior is added. The progress bar loads indefinitely.

References

For additional information about developing Web-based solutions for Internet Explorer, visit the following Microsoft Developer Network (MSDN) Web sites:
Internet Explorer updates
http://msdn.microsoft.com/ie/ (http://msdn.microsoft.com/ie/)
Using DHTML behavior
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/behaviors/howto/using.asp (http://msdn.microsoft.com/library/default.asp?url=/workshop/author/behaviors/howto/using.asp)
Using HTML components to implement DHTML behaviors in script
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/behaviors/howto/creating.asp (http://msdn.microsoft.com/library/default.asp?url=/workshop/author/behaviors/howto/creating.asp)
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use (http://go.microsoft.com/fwlink/?LinkId=151500) for other considerations.

Applies to
  • Microsoft Internet Explorer 6.0
  • Windows Internet Explorer 7
  • Windows Internet Explorer 8
Keywords: 
kbtshoot kbprb kbpending kbbug KB320731
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support