Difference between revisions of "Asynchronous module definition"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(cf)
Line 1: Line 1:
 
'''Asynchronous module definition''' ('''AMD''') is a [[JavaScript]] specification that defines an [[Application programming interface|API]] for defining code modules and their dependencies, and loading them asynchronously if desired.
 
'''Asynchronous module definition''' ('''AMD''') is a [[JavaScript]] specification that defines an [[Application programming interface|API]] for defining code modules and their dependencies, and loading them asynchronously if desired.
 +
 +
== Description ==
  
 
Benefits of AMD include:
 
Benefits of AMD include:
Line 19: Line 21:
 
* [[Asynchronous]]
 
* [[Asynchronous]]
 
* [[JavaScript]]
 
* [[JavaScript]]
 +
* [[Web application]]
  
 
== External links ==
 
== External links ==
  
 
* [https://en.wikipedia.org/wiki/Asynchronous_module_definition Asynchronous module definition] @ Wikipedia
 
* [https://en.wikipedia.org/wiki/Asynchronous_module_definition Asynchronous module definition] @ Wikipedia

Revision as of 11:11, 4 February 2016

Asynchronous module definition (AMD) is a JavaScript specification that defines an API for defining code modules and their dependencies, and loading them asynchronously if desired.

Description

Benefits of AMD include:

  • Website performance improvements.
    • AMD implementations load smaller JavaScript files, and only load them when they're needed.
  • Fewer page errors.
    • AMD implementations allow developers to define dependencies that must load before a module is executed, so the module doesn't try to use outside code that isn't yet available.

In addition to loading multiple JavaScript files at runtime, AMD implementations allow developers to encapsulate code in smaller, more logically-organized files in a way similar to other programming languages such as Java.

For production and deployment, developers can concatenate and minify JavaScript modules based on an AMD API into one file, the same as traditional JavaScript.

The AMD specification is implemented by Dojo Toolkit, RequireJS, and ScriptManJS.

See also

External links