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的用法的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2025-01-09百万架构师第十二课:源码分析:Spring 源码分析:Spring系统概述及IOC实现原理|JavaGuide
- 2025-01-08如何用关键链方法突破项目管理瓶颈?
- 2025-01-08电商人必看!6 款提升团队协作与客户满意度软件!
- 2025-01-08电商团队管理混乱?快用这 6 款软件优化协作流程!
- 2025-01-08短剧制作效率低?试试这5款任务管理工具
- 2025-01-08高效应对电商高峰,6 款团队协作软件大揭秘!
- 2025-01-08为什么外贸人都爱上了在线协作工具?
- 2025-01-08提升工作效率,从这些任务管理工具开始
- 2025-01-08新年电商订单暴增,必备的 6 款可视化协作办公软件有哪些?
- 2025-01-08短剧制作经理必备技能与工具全解析