Home > Web Front-end > JS Tutorial > body text

What should I do if jquery does not support ie8?

藏色散人
Release: 2022-12-30 11:13:50
Original
2516 people have browsed it

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]-->
Copy after login

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;);   
    }
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!