gpt4 book ai didi

javascript - 为特定的 ie 版本提供 flash 版本,否则提供 js 版本

转载 作者:行者123 更新时间:2023-12-02 17:42:18 31 4
gpt4 key购买 nike

我用 flash 和 js 版本创建了一个动画横幅。

是否可以检测低于版本 9 的 ie 版本,然后提供 Flash 横幅,否则提供 js 横幅。

最佳答案

您可以使用条件注释来检测 IE 版本

<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8"> <![endif]-->
<!--[if IE 9 ]> <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]-->

例如您可以在此评论中添加任何内容,它只会在 IE 9 以下的浏览器中显示

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

关于javascript - 为特定的 ie 版本提供 flash 版本,否则提供 js 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22096060/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com