Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

BUG: DHTML Dialog Box Does Not Show String Assigned to Document.Title


Symptoms

When you run script inside of a DHTML dialog box that was opened with the Document Object Model (DOM) methods window.showModalDialog() or window.showModelessDialog(), you can alter the value of the document.title property successfully. However, the new title never appears in the title bar of the dialog box.

This problem also occurs if you try to use the document.all collection to set the value of "TITLE".

↑ Back to the top


Resolution

To work around this problem, you can use Active Server Pages (ASP) script or another application server framework to set the title from the server side. There is no known alternative way to change the title from client-side script.

↑ Back to the top


Status

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

↑ Back to the top


More information

Steps to Reproduce Behavior

  1. Save the following HTML to a file named TestDialogTitle.htm:
    <html>
    <HEAD>
    <SCRIPT>
    function load() {
    	window.showModalDialog("dialog.htm");
    	//window.showModelessDialog("dialog.htm");
    }
    </SCRIPT>
    <title>DHTML Dialog Title Bug - Reproduction</title>
    </HEAD>
    <body onload="load();">
    </body>
    </html>
    					
  2. Save the following HTML to a file named Dialog.htm:
    <html>
    <head>
    <SCRIPT>
    function load() {
    	document.title = "Title Set From Script";
    }
    </SCRIPT>
    <title>Title Set in DHTML File</title>
    </head>
    <body onload="load();">
    </body>
    </html>
    					
  3. Run testDialogTitle.htm in Internet Explorer. You will see the DHTML dialog box appear with the title "Title Set in DHTML File," which is not the correct behavior.
  4. Close the DHTML dialog box and open Dialog.htm in the main browser window. You will see the title set to "Title Set From Script", which is the correct behavior that the DHTML dialog box failed to emulate.
  5. In TestDialogTitle.htm, comment out the top line of script and uncomment the second line to see the same problem with showModelessDialog().

↑ Back to the top


References

For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

↑ Back to the top


Keywords: KB263033, kbpending, kbieobj, kbbug, kbarchive, kbnosurvey

↑ Back to the top

Article Info
Article ID : 263033
Revision : 5
Created on : 6/19/2014
Published on : 6/19/2014
Exists online : False
Views : 153