Loving Coding & Visual Design

AMD loader

//Calling define with module ID, dependency array, and factory function
define('myModule', ['dep1', 'dep2'], function (dep1, dep2) {

//Define the module value by returning a value.
return function () {};
});

Why?

* Sync is bad, use Async
* hard to debug
* cross-domain requests
* load them before executing

Link: http://requirejs.org/docs/whyamd.html



下一页


最 近 文 章

  1. Centos mini常见问题 - Mon, 30 Nov -0001 00:00:00 +0000
  2. swift - Mon, 30 Nov -0001 00:00:00 +0000
  3. json_encode出错 Invalid UTF-8 sequence in argument - Mon, 30 Nov -0001 00:00:00 +0000
  4. Javascript循环的优先级 - Mon, 30 Nov -0001 00:00:00 +0000
  5. editplus 配置 yui 压缩 - Mon, 30 Nov -0001 00:00:00 +0000
  6. 关注的JS代码库 - Mon, 30 Nov -0001 00:00:00 +0000
  7. svn 出错:Directory is missing - Mon, 30 Nov -0001 00:00:00 +0000
  8. Unit Test - Mon, 30 Nov -0001 00:00:00 +0000
  9. PHPDoc - Mon, 30 Nov -0001 00:00:00 +0000
  10. yii框架快速入门 - Mon, 30 Nov -0001 00:00:00 +0000