location.href=document.getElementById('back_act').value;
//location.href="index.php";从A页面进入登陆页面,
url存入A页面地址,
http://www.1.com/user.php?back_act=http://www.1.com/sbuy/index.php
登陆完成跳到A页面.IE为嘛不兼容啊?
求教.

解决方案 »

  1.   


    window.location.href = "/index.aspx";感觉没啥问题;
      

  2.   

    是的.chrome firefox 都可以跳到http://www.1.com/sbuy/index.php 
    IE却是直接进入了会员中心.
      

  3.   

    url 没有变化,还是
    http://www.1.com/user.php?back_act=http://www.1.com/sbuy/index.php
      

  4.   

    最好贴出你的HTML代码,跳转代码是如何写的。
      

  5.   

    alert(document.getElementById('back_act').value)//////////
    location.href=document.getElementById('back_act').value;IE下你给控件赋值的时候有问题吧。。输出看看就知道是什么了
      

  6.   

    我自己写了代码测试.<div id="back_act">http://www.baidu.com</div>
    <input type="text" value="123456" id="a">
    <script>
    var new_url = document.getElementById('back_act').innerHTML;
    var new_num = document.getElementById("a").value;
    document.write(new_url);
    document.write(new_num);
    window.location.reload();
    location.href= new_num;
    //location.href = "http://www.google.com";
    </script>发现location.href=document.getElementById('back_act').value;并不存在兼容问题.
      

  7.   

    要 input,textarea 有 value 属性,其它要用 innerHTML 或 innerText
      

  8.   

    代码应该多截取一点.上面还有句
    window.location.reload();
    //alert一步一步排查,在这里写了代码才发现刷新的问题.
    location.href=document.getElementById('back_act').value;
    最后修改成了window.location.href=document.getElementById('back_act').value;解决了.大佬给解释一下,有了刷新IE底下为什么不正常?
      

  9.   

    window.location.reload();
    location.href= new_num;刷新和转向原本就是冲突的,刷新了页面就会卸载js不继续执行了,ie应该是执行reload就不继续执行href转向了,chrome的js引擎和ie不同,应该是执行了href转向。。要么就window.open代开新页面,并且放到window.location.reload();前面