javascirpt实现2个iframe之间传值的方法
来源:互联网 发布:淘宝详情页怎么做美观 编辑:程序博客网 时间:2024/05/18 18:00
本文实例讲述了javascirpt实现2个iframe之间传值的方法。分享给大家供大家参考,具体如下:
index.html
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title></head><body> <table border="1" width="100%"> <tr> <td width="100%"><iframe src="iframe1.html" name="aa"></iframe></td> </tr> <tr> <td width="100%"><iframe src="iframe2.html" name="bb"></iframe></td> </tr> </table></body></html>
iframe1.html
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <script> function aa() { parent.frames["bb"].document.all["TextBox3"].value = document.getElementById("TextBox1").value; parent.frames["bb"].document.all["TextBox4"].value = document.getElementById("TextBox2").value; alert(parent.frames["bb"].document.all["TextBox3"].value); alert(parent.frames["bb"].document.all["TextBox4"].value); } </script></head><body> <form id="a"> <input id="TextBox1" type="text" id="TextBox1" value="1"> <input id="TextBox2" type="text " id="TextBox2" value="2"> <input id="T" type="button" value="33333" onclick="aa()"> </form></body></html>
iframe2.html
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title></head><body> <form id="b"> <input id="TextBox3" type="text" id="TextBox1" value="1231111"> <input id="TextBox4" type="text" id="TextBox2" value="123"> </form></body></html>
转载自:http://www.jb51.net/article/87682.htm
阅读全文
0 0
- javascirpt实现2个iframe之间传值的方法
- javascirpt实现2个frame传值
- JS中Iframe之间传值的方法
- Iframe之间传值
- 实现拖放功能的javascirpt代码
- iframe 之间如何传值
- iframe高度自适应的6个方法
- iframe高度自适应的6个方法
- iframe高度自适应的6个方法
- iframe高度自适应的6个方法
- iframe高度自适应的6个方法
- 利用委托的方法实现2个窗体之间的通信的一个小练习
- 2个HTML之间的传值
- iframe 刷新 实现iframe之间刷新
- 得到2个经纬度之间距离的Java和Oracle实现方法
- iframe 父子页面之间的js函数调用方法
- iframe页面和父页面之间元素查找的方法
- 父页面和iframe页面之间方法的互相调用
- hdu4812 D Tree
- HDU 2700 Parity(签到)
- ZooKeeper 分布式安装手册:
- 遍历聚合对象中的元素——迭代器模式(二)
- Hibernate5在MySQL数据库中自动建表时报异常Error executing DDL via JDBC Statement
- javascirpt实现2个iframe之间传值的方法
- 浅谈static、类模板和函数模板
- 集群安装(单点与分布式成功安装)
- Mongodb更新数组$pull修饰符
- 《MySQL进阶》
- 使用 TCP 协议的面向连接的客户-服务器程序设计
- 浅谈 Spring 事务管理
- 加法变乘法
- ZooKeeper 快速搭建和客户端使用: