【问题标题】:pushState causing postback in IE 7 >pushState 在 IE 7 中导致回发 >
【发布时间】:2011-10-13 09:04:55
【问题描述】:

目前我正在做一个服务器端重定向,它像这样附加位置哈希......

SearchTerms[]=web&PageNo=1&PageSize=10&Sort=0&AllFacetGroups=null

当我调用 pushState 来更新位置哈希时,这会触发回发。

请注意,这不会发生在 FF 中,而是在 IE(7 及更高版本)中,出于某种奇怪的原因,它会触发回发。

我怎样才能阻止回帖的发生?

【问题讨论】:

    标签: javascript jquery-bbq


    【解决方案1】:

    在 IE 中解决这个问题的方法是使用 document.location.href 进行重定向,这会正确初始化位置哈希。使用服务器重定向无法初始化 document.location.hash。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-17
      • 2010-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多