JQuery Migrate 1.1.0 Released Considerations _jquery

Source: Internet
Author: User

When a developer needs to use a new version of jquery in their code, it can be used in versions 1.9 or 2.0 to detect which features have been deprecated or removed, and to recover these features if necessary. See the Project Readme for more information

The JQuery Migrate 1.1 builds on the previous version, with some improvements, including:


• Support Console.trace () to track warning messages and make it easier to diagnose errors.
• For invalid JSON, a warning message is returned.
• Prompt for "Logging is active" information to indicate that the plug-in is running.
• For security reasons, JQuery 1.9 limits the handling of strings, and you can restore that functionality through a new migrate plug-in. However, it is recommended that you use $.parsehtml () to process HTML.
• For $ ("<button>", {type: "button"}) An error warning is displayed
Finally, be aware that you can use the plugin to restore jquery to any version of the jquery 1.6.4 feature.

Precautions:

Last month it was noted that jquery releases versions 1.9 and 2.0, and the official team also launched the jquery Migrate Plugin 1.0.0 version, which is used in conjunction with jquery 1.9 or 2.0 to detect Jquey moved In addition to the features that will be removed, the Jquey feature that you developed previously can be used continuously, but it seems that many users do not know this plugin use, directly upgrade 1.9 or 2.0, did not load migrate plugin, causing the official received a lot of feed back is about some old work Can not use. After half a month JQuery official received many migrate plugin return problem, this time can be loaded through the Jquuery CDN, the program code is as follows.

Copy Code code as follows:

<script src= "Http://code.jquery.com/jquery-1.9.0.js" ></script>
<script src= "Http://code.jquery.com/jquery-migrate-1.1.0.js" ></script>

Compressed version

Copy Code code as follows:

<script src= "Http://code.jquery.com/jquery-1.9.0.min.js" ></script>
<script src= "Http://code.jquery.com/jquery-migrate-1.1.0.min.js" ></script>

With a perfect jQuery upgrade there is no need to migrate plugin, but the team is developing migrate plugin for developers to use in order for some of the features that have been removed to work properly. The Migrate plugin revision is mainly to add debug mode and preset to open, so that developers can know which programs must be modified before JQuery 1.9 can be used normally. Below is the new feature in version 1.1.0.
1. Preset to open the Trace function, all Browser if there is support Console.trace (), migrate preset will be directly displayed in the console interface, if the online site does not want to use this function, you can through Jquery.migratetrace = False to turn its functionality off.

2. "Logging is active" message: If you see this message represents that the page has been loaded migrate plugin, just let the developer know that it has been loaded correctly. Www.it165.net
3. Before the JQuery 1.9.0 version $.parsejson () supports invalid JSON values, such as "" or undefined, to return null instead of an error message, which MIGR Ate 1.1.0 also starts to support this feature and displays an error message.
4. $ ("<button>", {type: Button "}") writing in 1.9 does not support the IE6/7/8 version, as in Migrate 1.1.0 also supports this feature and displays an error message.
5. You can see Migrate Plugin on the jQuery Plugin site, or find it on Github.

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.