日期:2014-05-18  浏览次数:21129 次

表单提交后,如何关闭当前窗体,麻烦各位叔叔阿姨
请问表单提交后,如何关闭当前窗体呢,我使用以下方法,好象不行,并没有关闭窗体

<%
if   (request.getAttribute( "close ")!=null){
        out.print( " <script   language=\ "javascript\ "> window.close(); </script> ");
}
%>

------解决方案--------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN ">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME= "Generator " CONTENT= "EditPlus ">
<META NAME= "Author " CONTENT= " ">
<META NAME= "Keywords " CONTENT= " ">
<META NAME= "Description " CONTENT= " ">
<script>
function test(theform)
{
theform.submit();
window.close();
}
</script>
</HEAD>

<BODY>
<FORM METHOD=POST ACTION= "aaa.html ">
<INPUT TYPE= "text " NAME= "name "> <br>
<INPUT TYPE= "submit " value= "submit " onclick= "test(this.form); ">
</FORM>
</BODY>
</HTML>