AMD (Asynchronous module definition specification)

Source: Internet
Author: User

AMD Spec:Https://github.com/amdjs/amdjs-api/wiki/AMD

This specification defines only a function "define", which is a global variable. The description of the function is:

Define (ID?, dependencies, Factory);

The first parameter, ID, is a string. It refers to the name of the module in the definition, and this parameter is optional. If this parameter is not provided, the module name should default to the name of the specified script requested by the module loader. If this argument is provided, the module name must be "top-level" and absolute (relative names are not allowed).

The second parameter, dependencies, is an array of modules that are dependent on the module in the definition. The dependent modules must be executed according to the factory method precedence of the module, and the results of the execution should be passed in as parameters in the factory method of the module in the dependency array, in the order of the arguments.

A third parameter, factory, initializes the function or object to execute for the module. If it is a function, it should only be executed once. If it is an object, this object should be the output value of the module.

AMD (Asynchronous module definition specification)

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.