BUG: You cannot close an Internet Explorer window by using the window.setTimeout(window.close,1) method in Windows XP Service Pack 2 (884768)
The information in this article applies to:
- Microsoft Windows XP Professional SP2
- Microsoft Windows XP Home Edition SP2
- Microsoft Windows XP Media Center Edition Service Pack 2 (SP2)
- Microsoft Windows XP Tablet PC Edition Service Pack 2 (SP2)
SYMPTOMS When you click a hyperlink that is designed to
close a Microsoft Internet Explorer window, the Internet Explorer window does not
close. This problem occurs in Microsoft Windows XP Service Pack 2.CAUSEThe hyperlink uses the window.setTimeout(window.close,1) method to
close the Internet Explorer window.WORKAROUNDTo work around this problem, use
the window.setTimeout("window.close()", 1) method or the window.close() method to close the Internet Explorer window. You can use the following code sample to demonstrate the workaround. <html>
<body>
<script>
function TimeoutCloseWindow2()
{
window.setTimeout("window.close()", 1);
}
function DirectCloseWindow()
{
window.close();
}
</script>
<p>
<a href="javascript:TimeoutCloseWindow2();">Workaround 1: Click here to try to close the window by using window.setTimeout("window.close()", 1)</a>
</p>
<p>
<a href="javascript:DirectCloseWindow();">Workaround 2: Click here to try to close the window by using window.close()</a>
</p>
</body>
</html>
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed in the "Applies to" section.
Modification Type: | Major | Last Reviewed: | 10/11/2004 |
---|
Keywords: | kbtshoot kbhtml kbScript kbWebBrowser kbbug KB884768 kbAudDeveloper |
---|
|