A页面触发B页面事件
来源:互联网 发布:java中非线程安全的类 编辑:程序博客网 时间:2024/05/23 01:07
a.html
- <html>
- <body>
- 要传的值
- <input type='text' id='txtID' name='txtName' value='avalue' /> <br>
- <input type='button' value='open' onclick="window.open('b.html');" />
- <script>
- alert('刷新了页面');
- function method()
- {
- alert('a.html');
- }
- </script>
- </body>
- </html>
b.html
- html>
- <script>
- function getValue()
- {
- document.getElementById('txt').value=window.opener.document.getElementById('txtID').value;
- }
- </script>
- <body onload='getValue();'>
- 传过来的值是
- <input type='text' id='txt' />
- <input type='button' value='调用父窗口的方法' onclick='window.opener.method();' />
- <br>
- <br>
- <br>
- 设置父窗口的文本<input type='text' id='t' />
- <input type='button' value='执行'
- onclick='window.opener.document.getElementById("txtID").value=document.getElementById("t").value;' />
- <br>
- <br>
- <input type='button' value='刷新父窗口' onclick='window.opener.location=window.opener.location;' />
- <br>
- <br>
- <input type='button' value='关闭父窗口' onclick='window.opener.close();opener=null;' />
- </body>
- </html>
a.html
- <input type='button' value='showModalDialog' onclick="window.showModalDialog('c.html',window);" />
c.html
- <html>
- <script>
- function getValue()
- {
- if(window.dialogArguments)
- {
- document.getElementById('txt').value=window.dialogArguments.document.getElementById('txtID').value;
- }
- }
- </script>
- <body onload='getValue();'>
- 传过来的值是
- <input type='text' id='txt' />
- <input type='button' value='调用父窗口的方法' onclick='window.dialogArguments.method();' />
- <br>
- <br>
- <br>
- 设置父窗口的文本<input type='text' id='t' />
- <input type='button' value='执行'
- onclick='window.dialogArguments.document.getElementById("txtID").value=document.getElementById("t").value;' />
- <br>
- <br>
- <input type='button' value='刷新父窗口' onclick='window.dialogArguments.location=window.dialogArguments.location;' />
- <br>
- <br>
- <input type='button' value='关闭父窗口' onclick='window.dialogArguments.close();' />
- </body>
- </html>
0 0
- A页面触发B页面事件
- web页面a标签触发事件
- 页面关闭触发事件
- jquery 触发a标签点击事件,弹出页面
- 去掉手机页面a,button,input默认触发事件
- html 页面相应触发事件
- 页面载入自动触发事件
- 关闭页面时触发事件
- js页面加载触发事件
- A打开B页面,B页面的PageLoad事件第二次不能执行问题解决
- Javascript自动触发页面元素事件
- javascript自动触发页面元素事件
- asp.net页面中回车触发事件
- 防止页面刷新造成二次事件触发
- 页面装载完成后触发的事件
- 关于页面关闭时触发的事件
- js 打开(关闭)页面触发事件
- .net页面生存周期触发事件详解
- FileReference.Load 加载时,文件过大,IE内核浏览器会报:Error: Error #1000: 系统内存不足。
- 不开额外空间,交换A,B的值
- SQL Server Order by在union子句不可直接使用的原因
- java中equals和compareTo的区别---解惑
- C++ Concurrency in Action 书籍阅读
- A页面触发B页面事件
- linux下控制CPU不降频命令
- NYJO71&南阳理工oj_71(独木舟上的旅行) (贪心)
- 红黑树详解
- 大家一块来
- Oracle查看连接数并修改
- CreateDialog并关闭二级页面刷新父级页面
- MyBatis_与spring的整合之初步
- QCom MSM MDP显示驱动一些点的简记