检测IE6使用jQuery [英] Detect IE6 with Jquery

查看:134
本文介绍了检测IE6使用jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图确定如何检测1.3.X jQuery的IE浏览器 - !其德$ P $在1.3.x中pcated现在摆在你们写- 我知道这个。我有这个code

 如果(jQuery.browser.msie&安培;&安培; jQuery.browser.version ==6.0){
  警报(这是低于IE7);
}其他{
  警报(这是比IE7更大);
}

在IE8中运行它 - IE6(怪癖),IE7和IE8都比IE7少的回报。谁能帮我确定这个正确的使用jQuery ? (请注意:使用jQuery

编辑:我试图从根本上改变位置的元素在IE6到绝对和使用固定为IE7和IE8。不知道如何做到这一点没有检测浏览器吗?

EDIT2:看起来像这可能工作

  IF((window.XMLHtt prequest ==未定义)及及(ActiveXObject的=未定义)!){
    警报(这不是IE6);
       }其他{
    警报(这比IE6更大);
       }


解决方案

您总是可以做这样的事情用HTML或CSS ...为什么用jQuery做呢?

I am trying to establish how to detect the IE browser in jQuery 1.3.X - now before you all write "its deprecated in 1.3.x!" - I know this. I have this code

if (jQuery.browser.msie && jQuery.browser.version == "6.0") {
  alert ("This is less than IE7");
} else {
  alert ("This is greater than IE7");
}

When running it in IE8 - IE6 (quirks), IE7 and IE8 all return "less than IE7". Can anyone help me determine this correctly using jquery ? (please note: using jquery)

Edit: I am trying to basically change the position element in IE6 to "absolute" and use "fixed" for IE7 and IE8. Not sure how to do this without detecting browser?

Edit2: Seems something like this might work?

   if ((window.XMLHttpRequest == undefined) && (ActiveXObject != undefined)) {
    	alert ("This is not IE6");
       } else {
    	alert ("This is greater than IE6"); 
       }

解决方案

you can always do this sort of thing with html or css...why do it with jquery?

这篇关于检测IE6使用jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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