window.parent与window.openner区别 (转载)+原创
来源:互联网 发布:手机用什么网络加速器 编辑:程序博客网 时间:2024/05/21 05:42
转载文章地址:http://blog.csdn.net/zjb1989923/article/details/6856675
转载文章地址:http://blog.csdn.net/zjb1989923/article/details/6856675
nner区别
window.parent是iframe页面调用父页面对象,当我们想从iframe内嵌的页面中访问外层页面是可以直接利用window.parent获取;
例子如下:
A.html
<html>
<head>
</head>
<body>
</body>
</html>
B.html
<html>
<head>
<script type="text/javascript">
</script>
</head>
<body>
<span>文本框值为:</span><spanid="span1"></span><br/>
<input type="button" value="获取父窗口内的文本框值"onclick="getpValue();">
</body>
</html>
例子如下
a.html
<html>
<head>
</head>
<body>
</body>
</html>
b.html
<html>
<head>
<script type="text/javascript">
</script>
</head>
<body>
<span>文本框值为:</span><spanid="span1"></span><br/>
<input type="button" value="获取父窗口内的文本框值"onclick="getpValue();">
</body>
</html>
下面来举几个常用的例子:
parent.window与top.window一般在分割的页面即frameset或iframe中使用
注销整个框架后返回到login.aspx:parent.window.location='Login.aspx'或者
window.parent也是常在框架中使用,
刷新:window.parent.location.reload();或者刷新某个框架:window.parent.MainForm.location.reload();
获得其他框架的元素值:window.parent.MainForm.form1.text1.value;
window.opener主要是获得通过超链接或者 window.open()打开本身页面的页面的一些,比如获得值,刷新等
刷新:window.opener.location.reload();
获值:window.opener.document.getElement("txtName").value;
后退:top.playFrame.history.go(-1);
前进: top.playFrame.history.go(1);
刷新: top.playFrame.location.reload();
就总结到这里,这些对象很实用
--------------------------------------------------------------------------------------------------------
原创部分:
A.jsp底下有有三个:
<frameset rows="233,40,*" frameborder="NO" border="0" framespacing="0">
<frame name="B" scrolling="NO" noresize src="/a/B.jsp">
<frame name="C" scrolling="NO" noresize src="/a/C.jsp">
<frame name="D" scrolling="yes" noresize src="/a/D.jsp">
</frameset>
D.JSP里面,有两个:
<frameset cols="200,*" frameborder="NO" border="1" framespacing="0" rows="*">
<frame name="E" scrolling="yes" src="/a/E.jsp">
<frame name="F" src="/a/F.jsp" noresize scrolling="yes">
</frameset>
现在要去E里面显示内容。(在B里面)
window.parent(a).D.E.location.href=XXXXX;
- window.parent与window.openner区别 (转载)+原创
- window.parent与window.openner区别
- window.parent与window.openner区别
- window.parent与window.openner区别介绍
- window.parent与window.openner区别介绍
- window.parent与window.openner区别介绍
- window.parent与window.openner区别
- window.parent与window.openner区别介绍
- Jquery基础(七) window.parent与window.openner区别
- window.self ,window.parent ,window.openner的使用
- window.parent与window.opener的区别
- window.opener 与 window.parent 的区别
- window.opener 与 window.parent 的区别
- window.opener 与 window.parent 的区别
- window.parent与window.opener的区别
- window.parent与window.opener的区别
- window.parent与window.opener的区别
- window.parent与window.opener的区别
- qt基础
- 回退,返回到上一次操作的地方
- HTML5离线应用总结
- java里面关键字throws和throw的区别
- MySql字符转义
- window.parent与window.openner区别 (转载)+原创
- task和activity的关系
- pg_restore: [归档 (db)] could not execute query: 错误: 语言 "plpgsql" 已经存在
- 网游BUG提交解决方案
- spring管理filter
- 参考一
- 是否正在 IDE 中运行
- android:layout_gravity 和 android:gravity 的区别
- 年入10万房奴的悲惨生活,仅余5元过年[详细收支记录]