代码之家  ›  专栏  ›  技术社区  ›  Abs

奇怪的URL编码问题导致浏览器禁止发送消息

  •  1
  • Abs  · 技术社区  · 15 年前

    准备好迎接一些奇怪的事情。在Firefox中,以下功能正常:

    正在重定向到此URL:

    http://localhost/webs/van/front-end/slr/edit_rule.php?rule_name=test&rule_type=alloc_ext&copy=1
    

    但是,它在IE8中不起作用,因为它将上述内容转换为该内容,请注意末尾地址中的版权符号:

    http://localhost/webs/van/front-end/slr/edit_rule.php?rule_name=test&rule_type=alloc_ext©=1
    

    所以,我觉得很奇怪,让我们 encodeURIComponent 对此:

    window.location.href = 'edit_rule.php%3Frule_name%3Dtest%26rule_type%3Dalloc_ext%26copy%3D1';
    

    火狐和IE8现在都给了我一条禁止的信息!?!

    您没有访问/webs/van/front-end/slr/edit\rule.php的权限?此服务器上的rule_name=test2&rule_type=alloc_ext©=1。

    我不明白,怎么了?

    谢谢大家的帮助。

    2 回复  |  直到 15 年前
        1
  •  6
  •   Powerlord    15 年前

    & HTML encoded &

    &copy

        2
  •  0
  •   Roman Goyenko    15 年前

    ©