针对 Windows Phone 7 Internet Explorer 9 的条件注释

发布于 2024-12-26 15:17:24 字数 392 浏览 7 评论 0原文

问题

条件注释,例如

<!--[if IEMobile]>
    <p>Welcome to Internet Explorer Mobile.</p>
<![endif]-->
<![if !IEMobile]>
    <p>All other browsers</p>
<![endif]>

在 Windows Phone 7 上不起作用!或者,至少不是我的。


问题

有谁确切地知道如何使用这些评论,并且之前测试过它们? WP7 上的 IE 9 是否支持此功能?

Problem

Conditional comments, such as

<!--[if IEMobile]>
    <p>Welcome to Internet Explorer Mobile.</p>
<![endif]-->
<![if !IEMobile]>
    <p>All other browsers</p>
<![endif]>

don't work on Windows Phone 7! Or, at least not on mine.


Question

Does anyone know exactly how to use these comments, and had tested them before? Does IE 9 on WP7 even support this?

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

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

发布评论

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

评论(2

零度° 2025-01-02 15:17:24

尝试使用 gte(如果它显示您的手机为 7.5)

<!--[if gte IEMobile 7]>
<p>Welcome to Internet Explorer Mobile.</p>
<![endif]-->
<![if !IEMobile 7]>
<p>All other browsers</p>
<![endif]>

Try using gte (in case it's seeing your phone as 7.5)

<!--[if gte IEMobile 7]>
<p>Welcome to Internet Explorer Mobile.</p>
<![endif]-->
<![if !IEMobile 7]>
<p>All other browsers</p>
<![endif]>
可遇━不可求 2025-01-02 15:17:24

很抱歉地说,但以下内容在 Mango 之前曾经有效。

<!--[if IEMobile 7]>
    <p>Welcome to Internet Explorer Mobile.</p>
<![endif]-->
<![if !IEMobile 7]>
    <p>All other browsers</p>
<![endif]>

看起来现在您必须使用 JAvaScript 并检查 UserAgent 以查看是否列出了 Windows Phone OS 7 或 Windows Phone OS 7.5...唯一的方法

Im sorry to say but the following used to work before Mango.

<!--[if IEMobile 7]>
    <p>Welcome to Internet Explorer Mobile.</p>
<![endif]-->
<![if !IEMobile 7]>
    <p>All other browsers</p>
<![endif]>

It looks like now you would have to use JAvaScript and check the UserAgent to see if Windows Phone OS 7 or Windows Phone OS 7.5 is listed...Only way

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