关于location
---恢复内容开始---
一、最外层top跳转页面,适合用于iframe框架集
top.window.location.href("${pageContext.request.contextPath}/Login_goBack");
============================================================================================
二、window.location.href和window.location.replace的区别
1.window.location.href=“url”:改变url地址;
2.window.location.replace(“url”):将地址替换成新url,该方法通过指定URL替换当前缓存在历史里(客户端)的项目,
因此当使用replace方法之后,你不能通过“前进”和“后 退”来访问已经被替换的URL,这个特点对于做一些过渡页面非常有用!
三、强制页面刷新
1.window.location.reload():强制刷新页面,从服务器重新请求!
============================================================================================
四、window.location.reload();页面实现跳转和刷新
1 history.go(0)
2 location.reload()
3 location=location
4 location.assign(location)
5 document.execCommand('Refresh')
6 window.navigate(location)
7 location.replace(location)
8 document.URL=location.href
这几个都可以刷新
window.location.reload();刷新
window.location.href=window.location.href;刷新
window.close();关闭窗口,不弹出系统提示,直接关闭
window.close()相当于self属性是当前窗口
window.parent.close()是parent属性是当前窗口或框架的框架组
页面实现跳转的九种方法实例:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>navigate</title>
<script language="javascript">
setTimeout('window.navigate("top.html");',2000);
setTimeout('window.document.location.href="top.html";',2000);
setTimeout('window.document.location="top.html";',2000);
setTimeout('window.location.href="top.html";',2000);
setTimeout('window.location="top.html";',2000);
setTimeout('document.location.href="top.html";',2000);
setTimeout('document.location="top.html";',2000);
setTimeout('location.href="top.html";',2000);
setTimeout('location.replace("top.html")',2000);
//window对象
//document对象
//location对象
//href属性
//1.window.document.location.href
//2.window.document.location
//3.window.location.href
//4.window.location
//5.document.location.href
//6.document.location
//7.location.href
//8.window.navigate
//9.location.replace
//只要使用location方法,和任意的window对象,location对象,href属性连用,都可以页面的跳转////
</script>
</head>
<body>
页面将在2秒后跳转
</body>
</html>
解释:
location是个对象,比如本页的document.location和window.location的属性有
location.hostname = community.csdn.net
location.href = http://community.csdn.net/Expert/topic/4033/4033372.xml?temp=2.695864E-02
location.host = community.csdn.net
location.hash =
location.port =
location.pathname = /Expert/topic/4033/4033372.xml
location.search = ?temp=2.695864E-02
location.protocol = http:
可见href是location的属性,类别是string。
---恢复内容结束---
一、最外层top跳转页面,适合用于iframe框架集
top.window.location.href("${pageContext.request.contextPath}/Login_goBack");
============================================================================================
二、window.location.href和window.location.replace的区别
1.window.location.href=“url”:改变url地址;
2.window.location.replace(“url”):将地址替换成新url,该方法通过指定URL替换当前缓存在历史里(客户端)的项目,
因此当使用replace方法之后,你不能通过“前进”和“后 退”来访问已经被替换的URL,这个特点对于做一些过渡页面非常有用!
三、强制页面刷新
1.window.location.reload():强制刷新页面,从服务器重新请求!
============================================================================================
四、window.location.reload();页面实现跳转和刷新
1 history.go(0)
2 location.reload()
3 location=location
4 location.assign(location)
5 document.execCommand('Refresh')
6 window.navigate(location)
7 location.replace(location)
8 document.URL=location.href
这几个都可以刷新
window.location.reload();刷新
window.location.href=window.location.href;刷新
window.close();关闭窗口,不弹出系统提示,直接关闭
window.close()相当于self属性是当前窗口
window.parent.close()是parent属性是当前窗口或框架的框架组
页面实现跳转的九种方法实例:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>navigate</title>
<script language="javascript">
setTimeout('window.navigate("top.html");',2000);
setTimeout('window.document.location.href="top.html";',2000);
setTimeout('window.document.location="top.html";',2000);
setTimeout('window.location.href="top.html";',2000);
setTimeout('window.location="top.html";',2000);
setTimeout('document.location.href="top.html";',2000);
setTimeout('document.location="top.html";',2000);
setTimeout('location.href="top.html";',2000);
setTimeout('location.replace("top.html")',2000);
//window对象
//document对象
//location对象
//href属性
//1.window.document.location.href
//2.window.document.location
//3.window.location.href
//4.window.location
//5.document.location.href
//6.document.location
//7.location.href
//8.window.navigate
//9.location.replace
//只要使用location方法,和任意的window对象,location对象,href属性连用,都可以页面的跳转////
</script>
</head>
<body>
页面将在2秒后跳转
</body>
</html>
解释:
location是个对象,比如本页的document.location和window.location的属性有
location.hostname = community.csdn.net
location.href = http://community.csdn.net/Expert/topic/4033/4033372.xml?temp=2.695864E-02
location.host = community.csdn.net
location.hash =
location.port =
location.pathname = /Expert/topic/4033/4033372.xml
location.search = ?temp=2.695864E-02
location.protocol = http:
可见href是location的属性,类别是string。
关于location的更多相关文章
- OpenCASCADE Shape Location
OpenCASCADE Shape Location eryar@163.com Abstract. The TopLoc package of OpenCASCADE gives resources ...
- 【流量劫持】SSLStrip 终极版 —— location 瞒天过海
前言 之前介绍了 HTTPS 前端劫持 的方案,虽然很有趣,然而现实却并不理想.其唯一.也是最大的缺陷,就是无法阻止脚本跳转.若是没有这个缺陷,那就非常完美了 -- 当然也就没有必要写这篇文章了. 说 ...
- 巧用location.hash保存页面状态
在我们的项目中,有大量ajax查询表单+结果列表的页面,由于查询结果是ajax返回的,当用户点击列表的某一项进入详情页之后,再点击浏览器回退按钮返回ajax查询页面,这时大家都知道查询页面的表单和结果 ...
- 2000条你应知的WPF小姿势 基础篇<78-81 Dialog/Location/WPF设备无关性>
在正文开始之前需要介绍一个人:Sean Sexton. 来自明尼苏达双城的软件工程师.最为出色的是他维护了两个博客:2,000ThingsYou Should Know About C# 和 2,00 ...
- js 页面刷新location.reload和location.replace的区别小结
reload 方法,该方法强迫浏览器刷新当前页面. 语法: location.reload([bForceGet]) 参数: bForceGet, 可选参数, 默认为 false,从客户端缓存里取当前 ...
- android获取位置location为null的问题
12:38:542016-12-23 很多人经常遇到这种问题,主要是获取到位置的信息为null,第一个主要要有权限 <uses-permission android:name="a ...
- 解决安卓微信浏览器中location.reload 或者 location.href失效的问题
在移动wap中,经常会使用window.location.href去跳转页面,这个方法在绝大多数浏览器中都不会 存在问题,但早上测试的同学会提出了一个bug:在安卓手机的微信自带浏览器中,这个是失效的 ...
- nginx之location匹配优先级和安全问题
最近一直在做location的配置,遇到优先级别问题(如有配置不当,会存在安全隐患),以下是个人的一些学习体会 一.location 匹配符 1.等于匹配符: ##"=" ...
- js 刷新页面window.location.reload();
Javascript刷新页面的几种方法:1 history.go(0)2 window.location.reload() window.location.reload(true) 3 ...
- window.top.location.href 和 window.location.href 的区别
"window.location.href"."location.href"是本页面跳转. "parent.location.href" 是 ...
随机推荐
- python-其他常用模块
本节大纲: 模块介绍 time &datetime模块 random shutil shelve xml处理 yaml处理 configparser hashlib subprocess lo ...
- struts2.1笔记04:struts2优点
- Android(java)学习笔记115:Android InputMethodManager输入法简介
正文 一.结构 public final class InputMethodManager extends Object Java.lang.Object android.view.inputmeth ...
- Python文件IO
Python文件IO 有如下文本内容,文件路径为D:\temp,文件名称为lyric.txt, line1 Look ! line2 If U had one shot line3 One oppor ...
- Oracle 经典语法(一)
员工表 emp Name Type Nullable Default Comments -------- ------------ -------- ------- ----- ...
- RDS——mysql主从
测试一:RDS主 RDS从 只需要创建一个RDS数据库实例 1.版本 RDS:5.6.21 2.操作步骤 选中被操作的数据--->点击实例操作---->创建只读副本---& ...
- 集群服务器Session同步
事实上,网站总是有状态的.每一个登录信息.用户信息常常被存储在session内部.而当一个网站被部署在不止一台服务器的时候,就会遇到session同步的问题.事实上即使一个很小的网站,也要至少有两台服 ...
- poj 2057 树形dp 贪心
思路:设sum[i],le[i],back[i],worm[i]分别表示以i为根节点需要的完成步数,叶子节点数,失败回退步数,以及i是否有虫. #include<iostream> #in ...
- Windows 8.1 归档 —— Step 2 对新系统的少量优化
下面是来自 iplaysoft 的优化技巧:
- Android自动化测试介绍
1.随机事件测试.通过adb命令执行测试Monkey 就是SDK中附带的一个工具, 用来做压力测试.应用程序crash 和 ANR时会产生日志. 然后根据关键字分析,就可以把应用出现的问题抓出来. 2 ...