javascript当中open&close的用法

4.open&close
例 1.4.1(open&closeIEFF.html)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<SCRIPT LANGUAGE="JavaScript">
<!--
function choice()
{
    /* -
- aNewWindow = open()
- aNewWindow = open(aURL)
- aNewWindow = open(aURL, aName)
- aNewWindow = open(aURL, aName, aFeatureList)
*/
    window.open("cla.html");
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM METHOD=POST ACTION="" name="form1">
<INPUT TYPE="text" name="cla">
<INPUT TYPE="button" value="点我" οnclick="choice()" >
</FORM>
</BODY>
</HTML>

cla.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<SCRIPT LANGUAGE="JavaScript">
<!--
function returnV(t)
{
/*
Window.opener (Property)
A reference to the window that contained the link that opened this one.
*/
    window.opener.document.form1.cla.value=t.value;
/* Window.close() (Method)
This will close the window.
JavaScript syntax: - close()
- myWindow.close()
The method window.close() will attempt to close the window in which the script is executing.
*/  
    close();
}
//-->
</SCRIPT>
</HEAD>
 

更多内容请见原文,文章转载自:https://blog.csdn.net/qq_43650923/article/details/103044435

上一篇:java tcp socket readline 阻塞问题处理


下一篇:Python从目录中取出所有图像文件名写入一个文本文件 write writelines