浏览 2292 次
锁定老帖子 主题:js 子父窗口传值
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2008-11-25
-------------------------------------------------------------------- <!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=""> <meta http-equiv="Expires" CONTENT="0"> <meta http-equiv="Cache-Control" CONTENT="no-cache"> <meta http-equiv="Pragma" CONTENT="no-cache"> </HEAD> <FORM action="" method=POST id=form1 name=form1> <INPUT type="text" id=text1 name=text1> <INPUT type="button" value="打开子窗口" name=button1 onclick="window.open('b.html','popupnav', 'width=300,height=200,resizable=0,scrollbars=auto')"> </FORM> </HTML> -------------------------------------------------------------------- ----------------------------------b.html---------------------------- <HTML><HEAD> <SCRIPT> function button1_onclick() { window.opener.form1.text1.value = document.getElementById("name").value; window.close(); } </SCRIPT> </HEAD> <BODY> <input type="text" name="name" id="name" value=""> <INPUT type=button value="关闭" onclick="return button1_onclick()"> </BODY></HTML> -------------------------------------------------------------------- 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |