我正在寻找可以粘贴到页面上并完成它的好看的东西。
脚本应该检测早于 9 的 IE 版本,并显示一个漂亮的弹出窗口,其中包含指向不同浏览器或类似内容的链接。我可以自己做,但我不想重新发明轮子。
最佳答案
当我第一次发布这个答案时,modern.IE项目正在插入 IE6 countdown倡议,其中一部分是提供 IE 检测片段和托管图像,用于警告用户他们使用的是旧浏览器。
我最初链接到 http://www.ie6countdown.com/现在重定向到不再提供片段和图像的 modern.IE 上的一个区域。因此,为了繁荣和引用,这里是他们共享的代码和 imgur 上托管的原始横幅图片:
<!--[if lt IE 7]>
<div style=' clear: both; height: 59px; padding:0 0 0 15px; position: relative;'>
<a href="http://www.microsoft.com/windows/internet-explorer/default.aspx?ocid=ie6_countdown_bannercode">
<img src="http://i.imgur.com/hNingci.jpg" border="0" height="42" width="820" alt="" />
</a>
</div>
<![endif]-->
如果你想改变它来检测小于 9 的 IE 版本,只需将代码的第一位更改为:
<!--[if lt IE 9]>
关于用于检测旧版 Internet Explorer 并提供下载较新浏览器的 Javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10212503/