My jquery source-jquery1.11.x integrates with AMD

Source: Internet
Author: User

jquery1.11.x integrates with AMD

AMD joins jquery, where jquery divides the source into individual logic modules.

    1. Ready is integrated into a Deferred-dependent module.
    2. Some modules are cut into some more maintainable fragments.
    3. The module specified by the Var folder contains only shared variable declarations.
          (function(Global,Factory) {     if( typeofModule=== "Object" && typeofModule.Exports=== "Object" ) {        //For COMMONJS and Commonjs similar environments, if there is an appropriate window,        //Execute the Global factory method to obtain jquery objects;        //In environments where window,document are not inherently owned, such as node. JS,        //Get a jquery-made factory to serve Module.exports;        //This highlights the need to build a real window        //e.g var jQuery = require ("jquery") (window);Module.Exports=Global.Document? Factory( Global, true) : function(W) {             if( !W.Document){                 Throw New Error("jQuery requires a window with a document" );             }             return Factory( W);         };     } Else {         Factory( Global);     } }(typeofWindow!== "undefined" ?Window:  This, function(Window,Noglobal){     varJquery= {};     returnJquery; }));//The meaning is that jquery now supports node, and it takes global as a window in node.    

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.