IE9在某个页面自动进入兼容性视图

发布于 2024-12-05 23:47:46 字数 1270 浏览 0 评论 0原文

我目前正在管理一个不是我开发的电子商务网站。开发人员选择这样做,以便当您查看商品时,单击“添加到购物车”按钮,使用 jQuery 的“post”方法通过 Ajax 将商品的 ID 和指定数量发布到“/items/ajax_add_to_cart”。

我收到该网站所有者的报告,有两三个客户表示他们正在将商品添加到购物车中,但他们的购物车似乎是空的。我调查并在 Apache 访问日志中发现以下条目(IP 地址和 URL 已更改):

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)"

请注意,当访问“/items/ajax_add_to_cart”页面时,用户代理字符串意味着 Internet Explorer 9 自动进入兼容性视图。这就解释了为什么购物车最终是空的。不过,我根本无法复制这一点。

关于为什么会发生这种情况有什么想法吗?我可能会添加 标签来修复它,但我希望能够首先重现问题只是为了绝对确定发生了什么。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦途 2024-12-12 23:47:46

最近我被要求拯救两个 IE9 自动进入兼容性视图的网站。在这两种情况下,问题都出在单行 CSS 上。几乎难以置信。两种情况下的 CSS 都是有效且语法正确的。第一个是字体声明,第二个是字体系列声明。两者都包含一个字体堆栈。删除线路解决了问题。所以,这很可能不是您正在寻找的答案,但我建议检查 CSS!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文