window.location.href/replace/reload()--页面跳转+替换+刷新
一、最外层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。
window.location.href/replace/reload()--页面跳转+替换+刷新的更多相关文章
- 5. window.location.href/replace/reload()--页面跳转+替换+刷新
1.window.location=url; window.location 对象用于获得当前页面的地址 (URL),并把浏览器重定向到新的页面. 一.最外层top跳转页面,适合用于iframe框架集 ...
- "window.location.href"、"location.href"是本页面跳转
"window.location.href"."location.href"是本页面跳转 "parent.location.href"是上一 ...
- window.top.location.href 和 window.location.href 的区别
window.location.href 是本页面跳转 window.top.location.href是最外层的页面跳转
- 关于window.location.href页面跳转的坑
"window.location.href"."location.href"是本页面跳转 "parent.location.href"是上一 ...
- window.location.href跳转问题2
"window.location.href"."location.href"是本页面跳转 "parent.location.href"是上一 ...
- window.location.href跳转问题
任务中遇到这样一个问题,用window.location.href跳转一到个网址,但是每次都出错,显示网址前面加上了文件所在文件夹的路径 示例如下: window.location.href=&quo ...
- window.top.location.href 和 window.location.href 的区别
"window.location.href"."location.href"是本页面跳转. "parent.location.href" 是 ...
- 关于js中window.location.href,location.href,parent.location.href,top.location.href的用法
"window.location.href"."location.href"是本页面跳转 "parent.location.href"是上一 ...
- window.location.href的用法
在写ASP.Net程序的时候,我们经常遇到跳转页面的问题,我们经常使用Response.Redirect 做ASP.NET框架页跳转,如果客户要在跳转的时候使用提示,这个就不灵光了,如: Respon ...
随机推荐
- cf702A Maximum Increase
A. Maximum Increase time limit per test 1 second memory limit per test 256 megabytes input standard ...
- ubuntu 下修改host文件
原文地址:http://www.cnblogs.com/kingcat/archive/2012/02/23/2364509.html 有些时候,我们需要让某些域名指向本地,来实现调试,下面介绍下ub ...
- [Locked] Shortest Distance from All Buildings
Shortest Distance from All Buildings You want to build a house on an empty land which reaches all bu ...
- Timeout for tests
如果想把timeout太久的测试自动标记为失败,有两种方法: 1.在 @Test里加上 Timeout 参数 定义"timeout=1000“的话,如果超过1000 毫秒,failure会被 ...
- Esxi 5.0下配置LSI SAS RAID卡
公司有几台服务器,安装的是ESXI5.0的虚拟机,原来使用的是普通的台式机,现在新购的专用服务器并安装的LSI 8708 SAS RAID卡(服务器自带的板载RAID卡ESXI不支持),现在要将虚拟机 ...
- PostgreSQL和GreenPlum数据库的区别
PostgreSQL PostgreSQL是以加州大学伯克利分校计算机系开发的 POSTGRES,现在已经更名为POSTGRES,版本 4.2为基础的对象关系型数据库管理系统(ORDBMS).Po ...
- Android 网络技术HTTP
1.XML3种解析方式(DOM.SAX.PULL) 在网络上传输数据时最常用的格式有两种,XML 和JSON 这里首先明白什么是SAX是一个用于处理XML事件驱动的"推"模型,优点 ...
- 基于MyBatis的数据库切分框架,可实现数据的水平切分和垂直切分。 http://www.makersoft.org
https://github.com/makersoft/mybatis-shards MyBatis-Shards 专业的MyBatis数据库切分框架 MyBatis Shards简介 MyBati ...
- jquery中修改一个元素的值或内容
jquery中修改一个元素的值或内容,比如数值增加可以使用这个方法取得原值并+1 $this.text(function(i,ot){return Number(ot)+1;});
- 设置listview的header不能点击
View headView = inflater.inflate(R.layout.search_top, null); mListView.addHeaderView(headView ,null, ...