如果浏览器是Internet Explorer:请改为运行替代脚本 [英] If Browser is Internet Explorer: run an alternative script instead

查看:335
本文介绍了如果浏览器是Internet Explorer:请改为运行替代脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个在浏览器上非常重的图像轮播脚本。它在Opera和Chrome中效果很好,在FF中有一半不错,在IE中绝对打破我的球。所以我想给IE用户一个简单HTML的替代品,而不需要任何动作/ JS。

I'm using an image carousel script that is quite heavy on the browser. It works great in Opera and Chrome, half decent in FF and absolutely breaks my balls in IE. So i'd like to give IE users an alternative of simple HTML without any action/JS.

该脚本不使用MT或jQuery,而是使用380行JS。是否可以为IE用户提供纯HTML替代方案?

The script doesn't use MT or jQuery and its like 380 lines of JS. Would it be possible to give IE users a plain HTML alternative?

var browserName = navigator.appName;
if(browserName ==Microsoft Internet Explorer)
{
//我可以使用什么命令?
}

推荐答案

这篇文章很有说服力:http://msdn.microsoft.com/en-us/library/ms537509%28v=vs.85 %29.aspx

This article is quite explanatory: http://msdn.microsoft.com/en-us/library/ms537509%28v=vs.85%29.aspx.

如果你的JS不引人注目,你可以使用:

If your JS is unobtrusive, you can just use:

<![if !IE]>
   <script src...
<![endif]>

这篇关于如果浏览器是Internet Explorer:请改为运行替代脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆