window.top.location.href 和 window.location.href 的区别
如果访问的是iframe里面的页面,重新加载最外层的页面
<html>
<head>
<title></title>
<script language="javascript">
function escapeFrame(){
if (window.top.location.href != window.location.href) {
window.top.location.reload();
}
}
</script>
</head> <body onload="escapeFrame()">
<iframe src="b.html" ></iframe>
</body>
</html>
window.top.location.href 和 window.location.href 的区别的更多相关文章
- 关于js中"window.location.href"、"location.href"、"parent.location.href"、"top.location.href"的用法
location.href 和 window.location.href 区别: 1.location.href 可以直接跳转其他地址(不属于本项目) 也可以跳转本项目中的 2.window.loca ...
- window.top.location.href 和 window.location.href 的区别
window.location.href 是本页面跳转 window.top.location.href是最外层的页面跳转
- window.location.href和window.top.location.href的区别
if (window.location.href == window.top.location.href) { window.top.location.href = "/index. ...
- window.location.href和window.open的几种用法和区别
使用js的同学一定知道js的location.href的作用是什么,但是在js中关于location.href的用法究竟有哪几种,究竟有哪些区别,估计很多人都不知道了. 一.location.href ...
- window.location和window.location.href和document.location的关系
1,首先来区分window.location和window.location.href. window.location.href是一个字符串. 而window.location是一个对象,包含属性有 ...
- window.location.href 和 window.location.replace 的区别
window.location.href 和 window.location.replace 的区别 1.window.location.href=“url”:改变url地址: 2.window. ...
- window.location.Reload()和window.location.href 区别
首先介绍两个方法的语法: reload 方法,该方法强迫浏览器刷新当前页面.语法:location.reload([bForceGet])参数: bForceGet, 可选参数, 默认为 false, ...
- window.location.href 与 window.loaction.replace区别
window.location.href和window.location.replace的区别 1.window.location.href=“url”:改变url地址: 2.window.locat ...
- window.location.href和document.location.href、document.URL的区别
1.document表示的是一个文档对象,window表示的是一个窗口对象,一个窗口下可以有多个文档对象. 所以一个窗口下只有一个window.location.href,但是可能有多个documen ...
随机推荐
- Linus:C++是一种糟糕的语言
本文内容摘自http://blog.csdn.net/turingbook/article/details/1775488 C++是一种糟糕的(horrible)语言.而且因为有大量不够标准的程序员在 ...
- [LeetCode] Remove K Digits 去掉K位数字
Given a non-negative integer num represented as a string, remove k digits from the number so that th ...
- [LeetCode] Combination Sum III 组合之和之三
Find all possible combinations of k numbers that add up to a number n, given that only numbers from ...
- C#中Abstract和Virtual的区别
c# 中 Abstract和Virtual比较容易混淆,都与继承有关,并且涉及override的使用.下面讨论一下二者的区别: 一.Virtual方法(虚方法) virtual 关键字用于在基类中修饰 ...
- 【HDU 3037】Saving Beans Lucas定理模板
http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...
- Python3 Socket网络编程
Socket又称"套接字",应用程序通常通过"套接字"向网络发出请求或者应答网络请求,使主机间或者一台计算机上的进程间可以通讯. socket起源于UNIX,在 ...
- Javascript模板引擎插件收集
为什么要用JS的模板引擎,打个比方,如果你要通过接口绑定数据,最终要加进去DOM中,我们普遍的做法就是不断的+,最终append进去,但是这样的做法就是后续人员压根就没法维护.所以这时模板引擎出来了. ...
- ngrok反向隧道--获取内网IP
ngrok反向隧道 前情提要:小明与小白各有一台主机,两台主机在同一内网,小明想直接通过内网ssh到小白的主机上.但是小白的ip地址会不断的变化,而小明不想每次都要麻烦小白查看ip.于是小明催生了一个 ...
- mybatis源码分析:
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px "Helvetica Neue"; color: #e4af0a } p. ...
- UICollectionViewCell 网格显示数据
using System; using System.Collections.Generic; using Foundation; using UIKit; namespace ddd { publi ...