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">
随机推荐
- <scrapy爬虫>基本知识-修改链接-中间件
rules = ( Rule(LinkExtractor(allow=r'/films/\d+'),process_links='deal_links' ,callback='parse_maoyan ...
- SDOI2019 R2退役记
还是退役了呀 Day -1 早上loli发了套题结果啥都不会 之后胡爷爷就秒了道数据结构 不过也没什么人做,于是全机房都在愉快的划水 下午来机房打了场luogu的\(rated\)赛,还是啥都不会 之 ...
- PKU--1267 Cash Machine(多重背包)
题目http://poj.org/problem?id=1276 分析 这是一个多重背包的问题,可以把请求的金额当作背包的重量,而货币的面值就是价值又是重量. 于是这个问题便很好理解背包了. #];; ...
- nginx+supervisor 前后端分离项目的发布流程
[第一部分] 前端发布(vue项目),假设项目名为demo_vue Step1:编译打包前端项目 cd到demo_vue目录下, 执行cnpm run build:prod命令,生成disc文件夹 S ...
- bootstrap-select 插件示例
本文原创地址:http://www.cnblogs.com/landeanfen/p/7457283.html 一.组件开源地址以及API说明 bootstrap-select开源地址:https ...
- Odoo中使用的部分表名及用途
res_users 用户res_groups 用户组(角色)res_lang 语言res_partner 供应商/客户/联系人res_font 字体res_company 公司res_bank 银行r ...
- phpqrcode.php 生成二维码图片用于推广
<?php /* * PHP QR Code encoder * * This file contains MERGED version of PHP QR Code library. * It ...
- Linux 命令之head, tail, tr, sort, uniq, grep
head [filename] head -n 11 [filename] -> First 11 lines head -c 20 [filename] -> First 20 char ...
- 通过js 存取cookie
//存cookie function setCookie(name,value){ var Days = 30; var exp = new Date(); exp.setTime(exp.getTi ...
- spring cloud深入学习(九)-----配置中心服务化和高可用
在前两篇的介绍中,客户端都是直接调用配置中心的server端来获取配置文件信息.这样就存在了一个问题,客户端和服务端的耦合性太高,如果server端要做集群,客户端只能通过原始的方式来路由,serve ...