What to do if IE8 does not support the jQuery version?

coldplay.xixi
Release: 2020-11-30 11:48:19
Original
1598 people have browsed it

Solution to the problem that IE8 does not support the jQuery version: You can load the corresponding version of jQuery by determining the version of the IE browser. Only IE8 can recognize [ ], and some compatible operations can be performed in IE8 mode.

What to do if IE8 does not support the jQuery version?

The operating environment of this tutorial: windows7 system, jquery2.0.2 and jquery1.11.1 versions. This method is suitable for all brands of computers.

Solution to the problem that IE8 does not support the jQuery version:

You can load the corresponding version of jQuery by determining the version of the IE browser

Use statementSome compatible operations can be performed in IE8 mode. The code is as follows:

    
Copy after login

Explanation:

If it is not IE, use 2.02, IE8 and above also use 2.0.2, IE8 and below use version 1.11

Other matters:

1. I originally wanted to use if else, but I heard that else is not recommended, so I used two if

2. I see that the code for judging non-IE is a little different. The following is the explanation:

In non-IE, the following code is recognized as a comment and will be ignored:

Copy after login

But the following code is different, there is a sentence sandwiched between the two comments Code, will be ignored in IE, but will be recognized in non-IE.

 IE ignores this 
Copy after login

Related learning recommendations:javascript video tutorial

The above is the detailed content of What to do if IE8 does not support the jQuery version?. 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
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!