那要看另一页面是child or parent
if close child
parent.htm
function aa()
{gua=window.open()
.
.
gua.window.close()
}
--------------------
if close parent
child.htm
function aa()
{
.
.
.
openner.window.close()
}
if close child
parent.htm
function aa()
{gua=window.open()
.
.
gua.window.close()
}
--------------------
if close parent
child.htm
function aa()
{
.
.
.
openner.window.close()
}
Invoking the window.close method on an HTA closes the application without prompting the user because the HTA is trusted and follows a different security model.When a function fired by an event on any object calls the close method, the window.close method is implied. <SCRIPT LANGUAGE="JScript">
function foo() {
close();}
</SCRIPT>
<BODY onclick="foo();">
Click this page and window.close() is called.
</BODY>When an event on any object calls the close method, the document.close method is implied. <BUTTON onclick="close();">
Click this button and document.close() is called.
</BUTTON>Standards InformationThis method is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1