开发者

IE9 automatically entering Compatibility View on a certain page

I'm currently managing an e-commerce website that I did not develop. The developer chose to make it so that when you're viewing an item, clicking the "Add to Cart" button uses jQuery's "post" method to post the item's ID and the specified quantity to "/items/ajax_add_to_cart" via Ajax.

I got a report from the website's owner that two or three customers said that they were adding items to their shopping cart but that their shopping cart appeared to be empty. I investigated and found the following entries in the Apache access log (IP address and URLs changed):

127.0.0.1 - - [19/Sep/2011:12:49:50 -0400] "GET /items/view/1234 HTTP/1.1" 200 12117 "http://www.example.com/items/search/[keyword]" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; WOW64; Trident/5.0)"

127.0.0.1 - - [19/Sep/2011:12:50:15 -0400] "POST /items/ajax_add_to_cart HTTP/1.1" 200 15 "http://www.example.com/items/view/1234" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; Trident/5.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; OfficeLiveConnector.1.5; OfficeLivePatch.1.3; .NET4开发者_开发知识库.0C; BRI/1)"

127.0.0.1 - - [19/Sep/2011:12:50:16 -0400] "GET /items/view_cart HTTP/1.1" 200 10305 "http://www.example.com/items/view/1234" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; WOW64; Trident/5.0)"

Notice that when the "/items/ajax_add_to_cart" page is accessed, the user agent string implies that Internet Explorer 9 automatically went into Compatibility View. That explains why the cart ends up being empty. I'm not able to replicate this at all, though.

Any ideas on why this is happening? I will probably add the <meta http-equiv="X-UA-Compatible" content="IE=Edge"/> tag to fix it, but I'd like to be able to reproduce the problem first just to be absolutely certain of what's going on.


I have recently been asked to rescue two sites where IE9 has automatically gone into Compatibility View. In both instances the issue was a single line of CSS. Almost unbelievable. The CSS in both cases was valid with correct syntax. The first was a font declaration, the second a font-family declaration. Both contained a font stack. Removing the line fixed the problem. So, ths may well not be the answer you're looking for, but I'd say check the CSS!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜