zoukankan      html  css  js  c++  java
  • ie下,php HTTP_REFERER获取失败的整理

    HTTP_REFERER有效的情况
    1、以iframe 形式调用地址
    2、以window.open调用,打开新页面window.open(url);
    3、使用window.location.replace在Firefox 和Chrome下可以获取HTTP_REFERER
    window.location.replace(url);
    4、使用window.location.href在Firefox 和Chrome下可以获取HTTP_REFERER
    window.location.href = url;
    5、使用A标签跳转可以获取HTTP_REFERER

    HTTP_REFERER无效的情况
    1、使用函数 file_get_contents或file等函数调用URL地址,这个地址所在的文件无法获取HTTP_REFERER
    2、使用window.location.replace在IE6、IE7、IE8下无法获取HTTP_REFERER
    window.location.replace(url);
    3、使用window.location.href在IE6、IE7、IE8下无法获取HTTP_REFERER
    window.location.href = url;


    解决方法,在ie下,js跳转使用如下方法:
    1     function gotoUrl(url){
    2         var gotoLink = document.createElement('a');
    3 
    4         gotoLink .href = url;
    5 
    6         document.body.appendChild(gotoLink);
    7 
    8         gotoLink .click();
    9     }

    完美解决~~

  • 相关阅读:
    htm与html的区别
    CLR笔记:3.共享程序集合强命名程序集
    CLR笔记:5.基元,引用和值类型
    CLR笔记:13.数组
    CLR笔记:18.可空值类型
    正则表达式
    代码大全
    wcf的部署
    Json相关
    $.ready和onload
  • 原文地址:https://www.cnblogs.com/hongchenok/p/3884670.html
Copyright © 2011-2022 走看看