Return Value of ShowModalDialog Is Always Set to UNDEFINED for the About: Protocol In Internet Explorer 6.0 (327315)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) version 6.0

This article was previously published under Q327315

SYMPTOMS

When you use the About: Protocol with the ShowModalDialog function in a script on Microsoft Internet Explorer version 6.0, the return value of ShowModalDialog is always set to UNDEFINED (NULL). This problem does not occur with earlier versions of Internet Explorer.

To reproduce this issue, create the following HTM page :
<html>
<body>

<SCRIPT>
function MyMsgBox()
{
 url='about:<html><body onload="window.returnValue =true">test</body></html>';
 var result = window.showModalDialog (url);
 alert (result);
}
</SCRIPT>

<body onload="MyMsgBox()">
test
</body>
</html>
If you use Internet Explorer version 6.0 to load the page, Window.ShowModalDialog returns a value of UNDEFINED

WORKAROUND

To work around this behavior, you can do the following:
  1. Change the page extension to HTA.
  2. Do not pass the About: URLto ShowModalDialog. Pass the HTTP: URL instead.

STATUS

Microsoft has confirmed that this is a problem in Microsoft Internet Explorer 6.0.

Modification Type:MinorLast Reviewed:4/4/2005
Keywords:kbfix kbIE600preSP1fix kbprb kbIE600sp1fix KB327315