This article describes how to remove $ from jQuery1.9. browser replacement method. For more information, see $. browser uses regular expressions to match userAgent to determine the browser version and type. jquery has been declared in the jquery1.3.2 document. browser and jquery. browser. we recommend that you discard the version. You can use jquery. support.
JQuery removed $. browser and $. browser. version from version 1.9 and replaced it with $. support. In the latest version 2.0, IE 6/7/8 is no longer supported. Later, if you need to support IE 6/7/8, you can only use jQuery 1.9 or jQuery 1.10.1. To fully support IE and mix jQuery 1.9 and 2.0, the official solution is:
For a long time, this will facilitate processing separately based on browser features in complex cases, rather than simply detecting browser types and versions. However, at present, many old programs cannot be transplanted directly to support the features of the browser, so I have found some solutions that can be replaced directly on the Internet.
Determine the browser type:
$.browser.mozilla = /firefox/.test(navigator.userAgent.toLowerCase());$.browser.webkit = /webkit/.test(navigator.userAgent.toLowerCase());$.browser.opera = /opera/.test(navigator.userAgent.toLowerCase());$.browser.msie = /msie/.test(navigator.userAgent.toLowerCase());
The expression after the equal sign returns true/false, which can be directly used to replace the original $. browser. msie.
Check whether IE6 is used:
// Oldif ($.browser.msie && 7 > $.browser.version) {}// Newif ('undefined' == typeof(document.body.style.maxHeight)) {}
Check whether it is IE 6-8:
if (!$.support.leadingWhitespace) {}
We do not recommend that you use the browser type and version for determination.