1

我有一个网站,它与 IE8 无关。我目前有一个网站显示一个横幅,引导访问者升级 IE。我想做更多...

我想做的是,除了显示“抱歉您的浏览器不符合查看此站点的要求”之类的消息之外,还显示该横幅。我不希望它加载任何其他页面内容。

有没有办法说不要在 IE if 语句中加载页面的其余部分?

<!--[if lt IE 8]>
    <div style=' clear: both; text-align:center; position: relative;'>
        <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode"><img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." /></a>
    </div>

    -- Here is where I want to say DON'T LOAD ANYTHING ELSE.
    -- Maybe automatically redirect to another blank page?

<![endif]-->
4

4 回答 4

2

此类文档的基本结构:

<body>
<!--[if lte IE 8]
    <div style=' clear: both; text-align:center; position: relative;'>
        <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode"><img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." /></a>
    </div>
<![endif]-->
<!--[if gt IE 8] -->
    The rest of the document goes here. 
    All browsers except IE 8 and below parse this.

    ..content...

    Rigth at the end close the conditional.
<!-- <![endif]-->
</body>
</html>

注意应该是lte IE 8排除版本8。

于 2013-08-07T15:49:21.530 回答
1

如果你真的需要这样做,在head

<!--[if lt IE 8]>
    <meta  http-equiv="refresh" content="0;url=i_should_fix_this_for_ie8.html">
<![endif]-->
于 2013-08-07T15:48:09.143 回答
1
<!--[if lte IE 8]>
    <div style=' clear: both; text-align:center; position: relative;'>
        <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode"><img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." /></a>
    </div>
<![endif]-->

<!--[if gt IE 9]-->
    Here's where IE 9+ content goes (as well as content for any other browser).
<!--[endif]-->

根据下面 Juhana 的建议进行编辑。

于 2013-08-07T15:49:20.420 回答
0

实际上你可以做一些javascript来隐藏页面,比如隐藏内容,或者在它上面放置一个div,但最好的办法是让用户查看页面,不管它有多混乱。许多人经常使用旧的网络浏览器,这在企业网络上尤其如此。因此,如果您这样做,这些人可能根本无法查看您的页面。

于 2013-08-07T15:48:01.403 回答