jQuery 2.0 removes the judgment of browser version number (it recommends feature detection). Here is a native judgment method written by a foreigner. This code is really clever! Both brief and backward compatible! The general approach is: regular search for USER_AGENT;
However, due to historical reasons, USER_AGENT has always been inaccurate and has been changed in a mess by major manufacturers. :
For example:
IE10 : Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
IE11 : Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv 11.0) like Gecko
These are some messy strings. . . Who knows what IE12 will become! ! !
So using feature detection or USER-AGENT detection is neither reliable nor backwards compatible!
The following code is highly recommended!