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



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 5
  • Microsoft Internet Explorer (Programming) 5.01
  • Microsoft Internet Explorer (Programming) 5.5

This article was previously published under Q263033

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".

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.

STATUS

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

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().

REFERENCES

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

Modification Type:MajorLast Reviewed:5/11/2006
Keywords:kbBug kbieObj kbpending KB263033