子页面是父页面通过window.open弹出
2016-04-25 11:47
453 查看
1.父页面代码:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档title>
head>
<script language="javascript">
function tanchu()
{
window.open("Untitled-5.html");
}
script>
<body>
<form id="form1" name="form1" method="post" action="">
<label> <input type="submit" name="button" id="button" value="提交"
onclick="tanchu()" />
label> <label> <input type="text" name="textfield" id="textfield" />
label>
form>
</body>
</html>
2.子页面代码:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档title>
head>
<script language="javascript">
function aaa()
{
window.opener.document.getElementById("textfield").value='123123123';
}
script>
<body>
<form id="form1" name="form1" method="post" action="">
<label> <input type="submit" name="button" id="button" value="提交"
onclick="aaa()" />
label>
form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档title>
head>
<script language="javascript">
function tanchu()
{
window.open("Untitled-5.html");
}
script>
<body>
<form id="form1" name="form1" method="post" action="">
<label> <input type="submit" name="button" id="button" value="提交"
onclick="tanchu()" />
label> <label> <input type="text" name="textfield" id="textfield" />
label>
form>
</body>
</html>
2.子页面代码:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档title>
head>
<script language="javascript">
function aaa()
{
window.opener.document.getElementById("textfield").value='123123123';
}
script>
<body>
<form id="form1" name="form1" method="post" action="">
<label> <input type="submit" name="button" id="button" value="提交"
onclick="aaa()" />
label>
form>
</body>
</html>
相关文章推荐
- 百度地图&&覆盖物OverlayOptions
- linux sed 命令详解
- java.lang.NoSuchMethodError: org.apache.hadoop.hbase.HTableDescriptor.addFamily(Lorg/apache/hadoop/h
- 鸟哥私房菜linux基础学习笔记 6
- linux设置定时任务
- linux top命令详解
- 论div,button,input点击跳转页面不同window.open()
- OpenCv学习笔记(四)--Mat基本图像容器Mat对象信息头,矩阵体的创建,深复制,浅复制详解
- apache本地配置多域名(wampserver本地配置多域名)
- centos 7安装jdk和elk
- 阿里云ecs云服务器安装wdcp控制面板教程(推荐CentOS6.5)
- ipython是python的交互式shell工具
- Linux LVM硬盘管理及LVM扩容
- linux 删除一个月前的文件
- LVS 和 Nginx 和 HAproxy 的区别
- linux中利用find命令分析日志,统计包含某字符串的行数
- windows下apache+php+mysql 环境配置方法
- Tomcat提示“XDB 的服务器 localhost 要求用户名和密码”
- wampserver配置多个站点
- Linux系统resolv.conf配置信息丢失的解决方法