Article ID: 263033 - Last Review: May 11, 2006 - Revision: 3.0

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

System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
This article was previously published under Q263033

On This Page

Expand all | Collapse all

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:
http://msdn.microsoft.com/ie/ (http://msdn.microsoft.com/ie/)

http://support.microsoft.com/iep (http://support.microsoft.com/iep)

APPLIES TO
  • Microsoft Internet Explorer 5.0
  • Microsoft Internet Explorer 5.01
  • Microsoft Internet Explorer 5.5
Keywords: 
kbbug kbieobj kbpending KB263033
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.