Go [JavaScript] using jquery plugin error: $.browser is undefined workaround

Source: Internet
Author: User

Just started to think that the plug-in error, on the official website to download a latest version of the Jcrop plug-in, the results of the original project page opened is normal, and the introduction of the project will be error, I found that may be related to the plugin version of jquery, View the official Demo catalogue under the Juqery version is V1.3.2,
And I'm using the jquery version of V1.11.1, looking at the official jquery update log, which is really the problem.
About $.browser
Browser is used to get basic information about the browser.

JQuery, starting with version 1.9, removed $.browser and $.browser.version and replaced it with $.support.
In the updated version 2.0, IE 6/7/8 will no longer be supported. Later, if the user needs to support IE 6/7/8, only jQuery 1.9 can be used.
Workaround
If you want to fully support IE and mix jQuery 1.9 and 2.0, the official solution is:
<!--[if Lt IE 9]> <script src= ' jquery-1.9.0.js ' ></script> <! [endif]-->
<!--[if GTE IE 9]> <script src= ' jquery-2.0.0.js ' ></script> <! [endif]-->
In the long run, this facilitates separate processing based on browser features in complex situations, rather than simply detecting browser types and versions.
But now many of the old procedures are not migrated directly to the browser support features, so on the Internet to find some solutions that can be directly replaced.
Determine 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 the True/false, which can be used directly to replace the original $.browser.msie.

Part of this article is excerpted from: HTTP://WWW.FWOLF.COM/BLOG/POST/35


Original link: http://www.uedsc.com/jquery-browser-is-undefined.html

Go [JavaScript] using jquery plugin error: $.browser is undefined workaround

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.