开发者

pushState causing postback in IE 7 >

开发者 https://www.devze.com 2023-04-12 22:16 出处:网络
Currently I\'m doing a server side redirect which appends the location hash like so... SearchTerms[]=web&PageNo=1&开发者_开发问答;PageSize=10&Sort=0&AllFacetGroups=null

Currently I'm doing a server side redirect which appends the location hash like so...

SearchTerms[]=web&PageNo=1&开发者_开发问答;PageSize=10&Sort=0&AllFacetGroups=null

When I call pushState to update the location hash, this fires a post back.

Note this does not occur in FF but in IE (7 and above) for some strange reason it triggers a post back.

How can I stop the post back from happening?


Ok the hack to get round this in IE is to redirect using the document.location.href, this correctly initializes the location hash. Redirecting using the server fails to initialize the document.location.hash.

0

精彩评论

暂无评论...
验证码 换一张
取 消