IE bug之location.href没有referer
使用js实现跳转一般会用
location.href="www.google.com";
这样在一般的浏览器中可以在服务器端正常的获取referer,但是如果是IE浏览器就不正常了,解决方法是在IE中create一个a标签然后触发它的click事件。
//define for all browsers
function goto(url){
location.href = url;
} //re-define for IE
if(isIE){
function goto(url){
var referLink = document.createElement('a');
referLink.href = url;
document.body.appendChild(referLink);
referLink.click();
}
}
参考:http://webbugtrack.blogspot.com/2008/11/bug-421-ie-fails-to-pass-http-referer.html
IE bug之location.href没有referer的更多相关文章
- Safari 下用 "location.href = filePath" 实现下载功能的诡异 bug
Safari 下的一些诡异 bug 我们已经领教一二,比如前文中说的 无痕浏览模式下使用 localStorage 的 API 就会报错.今天我们要讲的是利用 location.href = file ...
- JavaScript在IE6下超级链接window.location.href不跳转的bug 及 解决方案
今天遇到个很诡异的问题,就是<a href="javascript:void(0);" onclick="window.location.href=url" ...
- 微信BUG之微信内置的浏览器中window.location.href 不跳转
最近做微信开发遇到这个问题,查了一些文档,总结一下 1.url后面加参数 indow.location.href = url +'?timestamp='+ new Date().getTime()+ ...
- 解决安卓微信浏览器中location.reload 或者 location.href失效的问题
在移动wap中,经常会使用window.location.href去跳转页面,这个方法在绝大多数浏览器中都不会 存在问题,但早上测试的同学会提出了一个bug:在安卓手机的微信自带浏览器中,这个是失效的 ...
- 安卓微信浏览器中location.href失效的问题
在移动web中,经常会使用window.location.href去跳转页面,这个方法在绝大多数浏览器中都不会存在问题,但是在安卓手机的微信自带浏览器中,会出现一个奇怪的bug. window.loc ...
- 安卓中location.href或者location.reload 不起作用
链接:https://www.cnblogs.com/joshua317/p/6163471.html 在移动wap中,经常会使用window.location.href去跳转页面,这个方法在绝大多数 ...
- window.location.href 跳转失败
我恨这个问题,因为困扰已久,做为一个不称职的半开发人员,对前端非常不熟,程度仅限于alert调试的水平 这个问题似乎是IE的一个傻逼哄哄的BUG引起的,在AJAX盛行的今天,当在返回success状态 ...
- 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"是上一 ...
随机推荐
- 使用jmeter做web接口测试
接口测试概述 定义 API testing is a type of software testing that involves testing application programming in ...
- keras&tensorflow+分布式训练︱实现简易视频内容问答框架
内容来源:Keras 之父讲解 Keras:几行代码就能在分布式环境训练模型 把 Keras API 直接整合入 TensorFlow 项目中,这样能与你的已有工作流无缝结合.至此,Keras 成为了 ...
- 学习nodejs部分基础内容入门小结
Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境. Node.js 使用了一个事件驱动.非阻塞式 I/O 的模型,使其轻量又高效. Node.js 的包管理器 n ...
- JS同源策略和跨域访问
同源策略(Same origin policy)是一种约定,它是浏览器最核心也最基本的安全功能,如果缺少了同源策略,则浏览器的正常功能可能都会受到影响.可以说Web是构建在同源策略基础之上的,浏览器只 ...
- 老师木发的makefile与autotools
makefile http://scc.qibebt.cas.cn/docs/linux/base/%B8%FA%CE%D2%D2%BB%C6%F0%D0%B4Makefile-%B3%C2%F0%A ...
- MAC OS X常用命令总结2
1. dir:显示某个目录下的子目录与文件. 格式:dir [x:] [Path] [filename][ parameter] 参数解释: /a 显示所有文件夹与文件. /p 分页 ...
- bzoj 4555 [Tjoi2016&Heoi2016]求和——NTT+第二类斯特林数
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4555 第二类斯特林数展开式: \( S(i,j) = \frac{1}{j!} \sum\l ...
- Linux 驱动层实现阻塞和非阻塞
linux应用层的函数默认是阻塞型的,但是要想真正实现阻塞,还需要驱动的支持才行. 例:open().scanf().fgets().read().accept() 等 1.默认情形,驱动层不实现阻塞 ...
- C# byte数组转成Bitmap对象
方法一: /// <summary> /// 将数组转换成彩色图片 /// </summary> /// <param name="rawValues" ...
- Linux_LVM Couldn't find device with uuid
Linux LVM commands result in Couldn't find device with uuid Couldn't find all physical volumes for v ...