Microsoft KB Archive/263033

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

Article ID: 263033

Article Last Modified on 5/11/2006

-

APPLIES TO


 * Microsoft Internet Explorer 5.0
 * Microsoft Internet Explorer 5.01
 * Microsoft Internet Explorer 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 &quot;TITLE&quot;.



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.



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

<div class="references_section">