JavaScript--location.href的跳转
页面重载
true 强制从服务器加载
false 优先从缓存加载
window.location.reload(true);
window.location.href、self.location.href、location.href是本页面跳转
parent.location.href 是上一层页面跳转
top.location.href 是最外层的页面跳转
window.history.forward() 前进
window.history.back() 后退
window.history.go(1) 前进
window.history.go(-1) 后退
window.location.href = "http://www.baidu.com";
window.location.assign("http://www.baidu.com");
window.location.replace("http://www.baidu.com");
window.location.assign(url) : 加载URL 指定的新的 HTML 文档。就相当于一个链接,跳转到指定的url,当前页面会转为新页面内容,可以点击后退返回上一个页面。
window.location.replace(url) : 通过加载 URL 指定的文档来替换当前文档 ,这个方法是替换当前窗口页面,前后两个页面共用一个
窗口,所以是没有后退返回上一页的

JavaScript--location.href的跳转的更多相关文章
- JavaScript在IE6下超级链接window.location.href不跳转的bug 及 解决方案
今天遇到个很诡异的问题,就是<a href="javascript:void(0);" onclick="window.location.href=url" ...
- IE6下window.location.href不跳转到相应url
前天一同事遇到个看似很诡异的问题,就是<a href="javascript:void(0);" onclick="window.location.href=url ...
- location.replace()和location.href=进行跳转的区别
location.href 通常被用来跳转到指定页面地址;location.replace 方法则可以实现用新的文档替换当前文档;location.replace 方法不会在 history 对象中生 ...
- 微信BUG之微信内置的浏览器中window.location.href 不跳转
最近做微信开发遇到这个问题,查了一些文档,总结一下 1.url后面加参数 indow.location.href = url +'?timestamp='+ new Date().getTime()+ ...
- 关于window.location.href页面跳转的坑
"window.location.href"."location.href"是本页面跳转 "parent.location.href"是上一 ...
- window.location.href无法跳转
onclick事件存在事件冒泡 所以要阻止它冒泡 解决:在onclick事件里添加return false阻止冒泡:onclick="window.location.href='XXXXX. ...
- IE浏览器 location.href 不跳转
var url = "https://www.cnblogs.com/zing"; location.href = url; window.event.returnValue = ...
- window.location.href无法跳转的解决办法
-------------------接收别人做的SSO单点登录项目,无源码,只是点击登出按钮一直不跳转. 原因是: <a href="javascript:;" oncli ...
- html中submit和button的区别/ window.location.href 不跳转 的问题
<input type="button"> <input type="submit"> 这两个的区别 是 button 不会自动提交表 ...
- ASP.NET MVC location.href不跳转
表单使用submit导致不跳转 <button type="button">
随机推荐
- 转:linux下的c/c++开发
源地址:http://zhidao.baidu.com/question/131261452.html 我就是做LINUX下的C开发的. 准确的说,LINUX下C才是主要的开发语言,但是写应用程序还是 ...
- shell脚本实现读取一个文件中的某一列,并进行循环处理
shell脚本实现读取一个文件中的某一列,并进行循环处理 1) for循环 #!bin/bash if [ ! -f "userlist.txt" ]; then echo &qu ...
- myeclipse启动jboss报ERROR [MainDeployer] Could not create deployment
今天用myeclipse启动jboss时报了这样的错,花了我将近一天的时间去解决这个问题,开始以为jar包问题,到最后发现是配置错了,所以分享一下.具体报错信息如下图: ERROR [MainDepl ...
- linux命令快速手记 — 让手指跟上思考的速度(四)
pm2 list:列出pm2方式启动的所有程序 pm2 monit:显示每个应用程序的CPU和内存占用情况 scp:远程复制和本地上传,适用于本地ssh登录到远程服务器 scp root@10.10. ...
- C++面向对象高级编程(下)第二周-Geekband
17,对象模型:关于vptr(vitrual Pointer)和vtbl(virtual Table) 当存在虚函数就会出现虚指针vptr指向虚函数所在位置vtbl 将vptr实现vtbl内容翻译为C ...
- Linux常用技巧
1.解决不能中文显示 xshell 终端语言显示选择UTF-8 #yum groupinstall chinese-support 2.heredocument报错“unexpected end of ...
- C开发系列-函数
概述 任何一个C语言程序都是有一个或多个程序段(小程序构成).每个程序都有自己的功能,我们一般称这些程序段为"函数". 函数的执行过程 #import <Foundation ...
- MYSQL错误代码和消息
服务器错误信息来自下述源文件: · 错误消息信息列在share/errmsg.txt文件中.“%d”和“%s”分别代表编号和字符串,显示时,它们将被消息值取代. · 错 ...
- str_replace函数的使用规则和案例详解
str_replace函数的使用规则和案例详解 str_replace函数的简单调用: <?php $str = '苹果很好吃.'; //请将变量$str中的苹果替换成香蕉 $strg = st ...
- wampserver配置服务
搭建服务器 windows下: 安装`WampServer`软件 1.什么是WampServer: WampServer,一般称之为 WAMP ,就是Windows Apache Mysql PHP集 ...