javascript当中open&close的用法
2021/11/28 20:42:30
本文主要是介绍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
这篇关于javascript当中open&close的用法的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-27本地多文件上传的简单教程
- 2024-11-27低代码开发:初学者的简单教程
- 2024-11-27如何轻松掌握拖动排序功能
- 2024-11-27JWT入门教程:从零开始理解与实现
- 2024-11-27安能物流 All in TiDB 背后的故事与成果
- 2024-11-27低代码开发入门教程:轻松上手指南
- 2024-11-27如何轻松入门低代码应用开发
- 2024-11-27ESLint开发入门教程:从零开始使用ESLint
- 2024-11-27Npm 发布和配置入门指南
- 2024-11-27低代码应用课程:新手入门指南