0

我不确定这是否曾经做过。有没有办法创建弹出消息,可能是 jQuery,出现在您的网站上,上面写着“注意!此网站可能无法在 Internet Explorer 版本中运行。我们建议使用 Firefox、Google Chrome、Opera 等。抱歉不便!”

更好!是否只有当用户在 Internet Explorer 中打开网站时才会弹出此通知?

我什至不知道从哪里开始这样的项目!帮助非常感谢!

4

3 回答 3

1

试试这个:http: //jsfiddle.net/meub/6TsnP/

HTML:

<!--[if IE]>
    <style type="text/css">
        .unsupported-browser {display:block;}
    </style>
<![endif]-->
<div class="unsupported-browser">
    <div class="container">
         <h2>Please note that this site doesn't support Internet Explorer.</h2>

        <p>We recommend using <a href="https://chrome.google.com">Google Chrome</a> or <a href="https://mozilla.org/firefox/">Firefox</a>.</p>
    </div>
</div>

CSS:

.unsupported-browser {
    /* Uncomment this for production use
    display:none;*/
    padding: 15px 0;
    color: #211E14;
    background-color: #FAE692;
    background-repeat: repeat-x;
    border-bottom: 1px solid #B3A569;
    position: fixed;
    top: 0px;
    left:0px;
    width: 100%;
}
.container {
    padding:40px;
    margin: 0px auto;
    max-width: 960px;
}
于 2013-09-04T23:30:46.743 回答
0

我能想到的最简单的方法:

<!--[if IE]>
<script src="yourscript.js"></script>
<![endif]-->

将您的弹出代码放在“yourscript.js”文件中,并在您的 HTML 代码中写入以上内容,仅当在 IE 中查看页面时才加载外部文件。(当然,您可以在条件语句中放置一个内联脚本,但我认为 IE 用户应该等待一些额外的毫秒来等待外部加载请求 XD - 我的意思是?)

编辑:我讨厌 IE !

于 2013-09-04T23:25:22.630 回答
0

将此添加到您的页面。

<script type="text/javascript>
    if(navigator.appVersion.indexOf("MSIE")!=-1)
    alert("Notice! This website etc.");
</script>

应该做的伎俩。但我认为这是一个糟糕的主意。

于 2013-09-04T23:26:46.947 回答