Jquery Internet Explorer浏览器兼容性问题 [英] Jquery internet explorer browser compatibility issue

查看:133
本文介绍了Jquery Internet Explorer浏览器兼容性问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

function runBrowserCheck()
{
  var bIE = false;
  var iBrowserType = -1;
  var iBogusBrowserVariant = 0;

  var cUserAgent = window.navigator.userAgent;
  var cAppName = window.navigator.appName;

  bIE = (cUserAgent.indexOf("msie") >= 0);

  if (bIE)
  {
    //IE8
    if (cUserAgent.indexOf("MSIE 8.0") >= 1)
        iBrowserType = 5;
    if (cUserAgent.indexOf("MSIE 9.0") >= 1)
        iBrowserType = 5;
  }
}





我使用此jquery来检查浏览器兼容性,但它显示Internet Explorer浏览器不兼容问题。



I am using this jquery to check browser compatibility,but it Shows Internet explorer browser incompatibility issue.

推荐答案

这里没有'jQuery函数'!

实际上jQuery删除了它的浏览器检测成员版本1.9及其原因是用户代理字符串成为不可靠的信息来源...

决定是否可以用JavaScript做某事的最佳方法是功能检测...

http://msdn.microsoft.com/en-us/magazine/hh475813.aspx [ ^ ]
There is no 'jQuery function' here!
In fact jQuery removed its browser detection member with version 1.9 and the reason is that user agent string is become a not reliable source of information...
The best way to decide if you can do something in JavaScript or not, is feature detection...
http://msdn.microsoft.com/en-us/magazine/hh475813.aspx[^]


这篇关于Jquery Internet Explorer浏览器兼容性问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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