本文介绍了哪个IE浏览器版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人有一个快速的脚本来查找哪个版本的IE页面是

正在查看?


具体来说,我想分开版本4从版本5+开始,并发布

警告反对使用4.


我希望我必须搜索(navigator.appAgent)字符串对于

的MSIE子串,但因为直到明天我才需要它,懒惰

决定我在这里问之前再继续它。还有另一个

变量吗?一个不那么繁琐的方式?


提前致谢。


韦德

Does anyone have a quick script to find which version of IE a page is
being viewed with?

Specifically, I want to seperate version 4 from versions 5+, and post a
warning against using 4.

I expect I''ll have to search out the (navigator.appAgent) string for
the MSIE substring, but since I don''t need it until tomorrow, laziness
dictates I ask here before getting on with it. Is there another
variable? a less cumbersome way?

Thanks in advance.

Wade

推荐答案




在其他人建议之前:使用User-Agent标题不是

可靠< http://pointedears.de /脚本/测试/ whatami取代。如果知道

诺顿网络安全版修改,甚至删除用户代理标题。


低于5.0的IE版本不支持W3C DOM,所以这可能是一个

指标。除了测试document.all之外,这应该足够了。

AFAIK Opera实现了document.all,但它也实现了W3C-DOM。

我不知道关于IE的问题Mac,它可能会有所不同。


然而,应该针对6.0 SP-1以下的所有IE发出警告,其中许多

安全漏洞有已修复。

HTH


PointedEars



Before anyone else suggests it: Using the User-Agent header is not
reliable <http://pointedears.de/scripts/test/whatami>. If know that
Norton Internet Security modifies, even removes the User-Agent header.

IE versions below 5.0 do not support the W3C DOM, so this may be one
indicator. Along with testing for document.all, this should suffice.
AFAIK Opera implements document.all but it also implements the W3C-DOM.
I do not know about IE for the Mac, it is likely to be different there.

Yet the warning should be issued for all IEs below 6.0 SP-1 where many
security bugs have been fixed.
HTH

PointedEars





由于各种原因,浏览器检测通常是一个很大的禁忌,但如果你只是想要区分IE版本,请使用IE-sp ecific代码(被其他浏览器忽略

)。


IE条件评论:



我不认为这些天有太多人使用IE4。


-

-

~kaeli~

我要问的是有机会证明钱不能让我

快乐。





Browser detection is usually a big no-no for various reasons, but if you just
want to distinguish between IE versions, use IE-specific code (ignored by
other browsers).

IE conditional comments:
http://msdn.microsoft.com/workshop/a...omment_ovw.asp

I don''t think too many people use IE4 these days, though.

--
--
~kaeli~
All I ask is the chance to prove that money cannot make me
happy.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace




在其他人建议之前:使用User-Agent标头不可靠< http:/ /pointedears.de/scripts/test/whatami> ;.如果知道诺顿网络安全版修改了,甚至删除了用户代理标题。

低于5.0的IE版本不支持W3C DOM,所以这可能是一个
指标。除了测试document.all之外,这应该足够了。
AFAIK Opera实现了document.all,但它也实现了W3C-DOM。
我不知道有关Mac的IE,它很可能是那里不同。

然而,应该针对6.0 SP-1以下的所有IE发出警告,其中许多
安全漏洞已得到修复。



Before anyone else suggests it: Using the User-Agent header is not
reliable <http://pointedears.de/scripts/test/whatami>. If know that
Norton Internet Security modifies, even removes the User-Agent header.

IE versions below 5.0 do not support the W3C DOM, so this may be one
indicator. Along with testing for document.all, this should suffice.
AFAIK Opera implements document.all but it also implements the W3C-DOM.
I do not know about IE for the Mac, it is likely to be different there.

Yet the warning should be issued for all IEs below 6.0 SP-1 where many
security bugs have been fixed.




除了Thomas所说的,你可能还要考虑条件

评论:


< url:
/>


是的,它只是Internet Explorer,但毕竟,你试图确定

IE版本,所以它不是一个问题,它是一种专有的方式。

条件评论和下层隐藏的条件评论降级

非常好。我不确定是否支持MAC上的条件评论,然后又是b $ b,你可能不希望它告诉人们升级到版本6

on MAC,因为没有这样的动物。


你可能正在寻找类似的东西:


<! - [if lt IE 6]>

< P>请升级到Internet Explorer 6.< / P>

<![endif] - >

<![if!lt IE 6]>

<! - 用于IE 6和其他浏览器的内容 - >

<![endif]>


您可以使用更具体的版本更准确地识别IE 6SP1

数字(<! - [if lt IE 6.0.2800]>)。阅读版本载体在URL上我提供了有关定位的更多信息(以及一些警告)

特定的版本。


-

Grant Wagner< gw ***** @ agricoreunited.com>

comp.lang.javascript常见问题 -



In addition to what Thomas has said, you may want to consider Conditional
Comments:

<url:
http://msdn.microsoft.com/workshop/a...omment_ovw.asp />

Yes, it''s Internet Explorer only, but after all, you''re trying to determine
IE versions, so it''s not a problem that it''s a proprietary way of doing that.
The Conditional Comments and Downlevel-hidden Conditional Comments degrade
quite nicely. I''m not sure about support for Conditional Comments on the MAC,
then again, you probably don''t want it telling people to upgrade to version 6
on the MAC since there is no such animal.

You''re probably looking for something like:

<!--[if lt IE 6]>
<P>Please upgrade to Internet Explorer 6.</P>
<![endif]-->
<![if !lt IE 6]>
<!-- content intended for IE 6 and other browsers -->
<![endif]>

You can probably identify IE 6SP1 more accurately using more specific version
numbers (<!--[if lt IE 6.0.2800]>). Read "Version Vectors" on the URL I
provided for more information (and some warnings) about targeting too
specific a version.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq


这篇关于哪个IE浏览器版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 20:55