Home  >  Article  >  Web Front-end  >  What should I do if jquery does not support ie8?

What should I do if jquery does not support ie8?

藏色散人
藏色散人Original
2021-02-05 09:34:292468browse

jquery does not support ie8 because jQuery versions above jquery2.0 no longer support IE browsers of IE8 and below. The solution is to use jquery1.9 version.

What should I do if jquery does not support ie8?

The operating environment of this article: Windows7 system, jquery1.9, Dell G3 computer.

jquery does not support ie8?

JQuery version 2.0 or above no longer supports IE8 and below versions of IE browsers. Just use jquery1.9 version.

Solution:

<!--IE8只能支持jQuery1.9-->
<!--[if lte IE 8]>
<script src="http://cdn.bootcss.com/jquery/1.9.0/jquery.min.js"></script> 
<![endif]-->

Related issues:

Jquery no longer handles compatibility with lower versions of IE (IE6, IE7, IE8) starting from version 2.x . If you need to be compatible with lower versions of IE, it is recommended to use native JS or lower versions of Jquery1.x.

The general method is to write two or more sets of JS codes for the web page to adapt to different versions and types of browsers, and then use native JS to determine the browser model and version to load different JS files. The specific implementation method is as follows:

//判断是否为IE浏览器
if(navigator.appName == "Microsoft Internet Explorer") {
    if(navigator.appVersion.match(/7./i) == &#39;6.&#39;
     || navigator.appVersion.match(/7./i) == &#39;7.&#39;
     || navigator.appVersion.match(/7./i) == &#39;8.&#39;){
        document.write(&#39;<script src="myjs1.js"></script>&#39;);   
    }else{          
        document.write(&#39;<script src="myjs2.js.js"></script>&#39;);   
    }
}

Recommended: "jquery video tutorial"

The above is the detailed content of What should I do if jquery does not support ie8?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn