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
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
最 近 文 章
- Centos mini常见问题 - Mon, 30 Nov -0001 00:00:00 +0000
- swift - Mon, 30 Nov -0001 00:00:00 +0000
- json_encode出错 Invalid UTF-8 sequence in argument - Mon, 30 Nov -0001 00:00:00 +0000
- Javascript循环的优先级 - Mon, 30 Nov -0001 00:00:00 +0000
- editplus 配置 yui 压缩 - Mon, 30 Nov -0001 00:00:00 +0000
- 关注的JS代码库 - Mon, 30 Nov -0001 00:00:00 +0000
- svn 出错:Directory is missing - Mon, 30 Nov -0001 00:00:00 +0000
- Unit Test - Mon, 30 Nov -0001 00:00:00 +0000
- PHPDoc - Mon, 30 Nov -0001 00:00:00 +0000
- yii框架快速入门 - Mon, 30 Nov -0001 00:00:00 +0000