页面跳转和iframe相互访问
2015-10-08 19:53
288 查看
页面跳转的方法:
假如有A,B,C三个页面,C是B的iframe, B是A的iframe
第一种:本页面的跳转
第二种:父页面的跳转
第三种:祖父页面的跳转
第四种:子页面的跳转
第五种:孙子页面的跳转
第六种:超链接
注意:可以通过设置target属性,实现不同方式的跳转页面。
多个嵌套iframe之间的相互访问全局变量和全局函数
第一种:子iframe的访问
第二种:父iframe的访问
第三种:最外层iframe的访问
第四种:平级iframe的访问
转载:——/article/5205380.html
转载:——http://www.doc88.com/p-570321598222.html
转载:——/article/1492414.html
假如有A,B,C三个页面,C是B的iframe, B是A的iframe
第一种:本页面的跳转
location = window.location =location.href = window.location.href =self.location.href = "url地址"; window.open("url地址","_self");
第二种:父页面的跳转
parent.location.href=window.parent.location.href=window.parent.window.location"url地址"; window.open("url地址","_parent");
第三种:祖父页面的跳转
parent.parent.location=top.location.href=window.top.location.href"url地址"; window.open("url地址","_top")==parent.open("url地址","_parent")=parent.parent.open("url地址","_self");
第四种:子页面的跳转
将iframe的src修改即可,如:<iframe src="D.html" name="sonIframe">; window.sonIframe.location="D.html";
第五种:孙子页面的跳转
window.sonIframe.grandsonIframe.location="D.html"; window.sonIframe.document.getElementById('grandsonIframeId').src="D.html";
第六种:超链接
<a>的跳转
<a href="D.html" target="_self">跳转到D.html页面</a> /*默认_self是在本窗口跳转*/ window.open("url地址","_blank");//默认_blank是在新窗口跳转
注意:可以通过设置target属性,实现不同方式的跳转页面。
多个嵌套iframe之间的相互访问全局变量和全局函数
第一种:子iframe的访问
调用方法:window.sonIframe.ff(); 调用变量:window.sonIframe.vv;
第二种:父iframe的访问
调用方法:window.parent.ff(); 调用变量:window.parent.vv;
第三种:最外层iframe的访问
调用方法:window.parent.parent.ff(); 调用变量:window.top.vv;
第四种:平级iframe的访问
top.frames["sonIframeone"].sonIframeone("调用平级的另一个iframe的方法");
转载:——/article/5205380.html
转载:——http://www.doc88.com/p-570321598222.html
转载:——/article/1492414.html
相关文章推荐
- nginx location匹配规则
- 这样好用的ReactiveCocoa,根本停不下来【转载】
- top 命令详解
- border
- BestCoder #58 div1
- UVA437
- LeetCode OJ:Valid Palindrome(验证回文)
- 关于一些对location认识的误区
- CYC-爱心暖暖的小动画
- UESTC 1712 Easy Problem With Numbers 除法对和数取模,分解,线段树
- Java 安全套接字编程以及 keytool 使用最佳实践
- 第6周项目2--建立链栈算法库
- NSUserDefaults
- 【前端学习】javascript作用域(链)和this
- UIScorollView运用与属性详解
- 最小生成树之prim算法
- 仓储管理流程图
- 导入https证书
- 地图的基础使用
- 使用 TestLink 进行测试管理