转 top.location.href和localtion.href有什么不同
来源:互联网 发布:思迅软件u盘 编辑:程序博客网 时间:2024/04/29 18:40
<div class="postTitle" style="font-size: 14.7px; font-weight: bold; margin-bottom: 10px; font-family: verdana, Arial, helvetica, sans-seriff;"><span style="color: rgb(75, 75, 75); line-height: 19.200000762939453px; font-size: 14px;">top.location.href=”url” <span style="white-space: pre;"></span>在顶层页面打开url(跳出框架) </span><a target=_blank target="_blank" name="baidusnap0" class=" " style="color: rgb(75, 75, 75); line-height: 19.200000762939453px; background-color: rgb(240, 240, 240); font-size: 14px;"></a></div><div class="postTitle" style="font-size: 14.7px; font-weight: bold; margin-bottom: 10px; font-family: verdana, Arial, helvetica, sans-seriff;"><span style="color: black; line-height: 19.200000762939453px; font-size: 14px; background-color: rgb(255, 255, 102);">self.location.href</span><span style="color: rgb(75, 75, 75); line-height: 19.200000762939453px; font-size: 14px;">=”url” <span style="white-space: pre;"></span>仅在本页面打开url地址 </span></div><div class="postTitle" style="color: rgb(75, 75, 75); font-size: 14.7px; font-weight: bold; margin-bottom: 10px; font-family: verdana, Arial, helvetica, sans-seriff;"><span style="line-height: 19.200000762939453px; font-size: 14px;">parent.location.href=”url” 在父窗口打开Url地址 </span></div><div class="postTitle" style="color: rgb(75, 75, 75); font-size: 14.7px; font-weight: bold; margin-bottom: 10px; font-family: verdana, Arial, helvetica, sans-seriff;"><span style="line-height: 19.200000762939453px; font-size: 14px;">this.location.href=”url” <span style="white-space: pre;"></span>用法和self的用法一致 </span></div><div class="postTitle" style="color: rgb(75, 75, 75); font-size: 14.7px; font-weight: bold; margin-bottom: 10px; font-family: verdana, Arial, helvetica, sans-seriff;"><span style="line-height: 19.200000762939453px; font-size: 14px;"></span></div><div class="postTitle" style="color: rgb(75, 75, 75); font-size: 14.7px; font-weight: bold; margin-bottom: 10px; font-family: verdana, Arial, helvetica, sans-seriff;"><span style="line-height: 19.200000762939453px; font-size: 14px;">if (top.location == self.location) 判断当前location 是否为顶层来 </span><span style="font-size: 14px; line-height: 1.5; color: rgb(250, 128, 114);">禁止frame引用</span><span style="line-height: 19.200000762939453px; font-size: 14px;"> </span></div><div class="postTitle" style="color: rgb(75, 75, 75); font-size: 14.7px; font-weight: bold; margin-bottom: 10px; font-family: verdana, Arial, helvetica, sans-seriff;"><span style="line-height: 19.200000762939453px; font-size: 14px;">如果页面当中有自定义的frame的话,也可以将parent self top换为自定义frame的名称 效果就是在自定义frame窗口打开url地址</span><p style="margin: 10px auto; line-height: 19.200000762939453px;"></p><p style="margin: 10px auto; line-height: 19.200000762939453px;">实际中可能这样使用</p><p style="margin: 10px auto; line-height: 19.200000762939453px;"> if(top !== self){ top.location.href = location.href; } <span style="line-height: 1.5; color: rgb(250, 128, 114);">禁止frame引用</span></p><p style="margin: 10px auto; line-height: 19.200000762939453px;"><span style="line-height: 1.5; color: rgb(250, 128, 114);">http://blog.csdn.net/lisheng19870305/article/details/41074893</span></p></div>
0 0
- 转 top.location.href和localtion.href有什么不同
- top.location.href和localtion.href有什么不同
- top.location.href和localtion.href有什么不同
- top.location.href和localtion.href有什么不同
- top.location.href和localtion.href有什么不同
- top.location.href和localtion.href有什么不同
- top.location.href和localtion.href有什么不同
- top.localtion.href和top.localtion.replace
- window.top.location.href 和 window.location.href 的区别
- window.top.location.href 和 window.location.href 的区别
- window.location.href和window.top.location.href的区别
- window.location.href和window.top.location.href的区别
- $state.go和$location.href有什么区别
- top.location.href"、"window.location.href"和"parent.location.href"的区
- JSP中window.location.href"、"location.href"、"parent.location.href"、"top.location.href"和"target属性"的用法
- top.location.href windows.location.href
- top.location.href = window.location.href;
- top.location.href、parent.location.href
- 学习
- easyui框架搭建
- ASCII码表全部
- 在Linux上安装ArcGIS许可管理器备忘录
- MyEclipse+phpEclipse+xampp的安装与配置,万里长征第一步!
- 转 top.location.href和localtion.href有什么不同
- Java 爬虫工具/开源API对比
- Java 关键字详解
- C#禁止重复提交
- 每隔3位添加一个逗号
- 逻辑回归的深入理解总结
- Fragment+RadioGroup实现底部菜单栏(二)
- iOS开发多线程篇—GCD介绍
- 《开源框架那点事儿11》:软件开发杂谈