标签:javascript amd
require([B,C],function(B,C){ var A = {}; A.say = B.say; A.run = C.run; return A; }); B.js define([], function(){ var B = {}; B.say = function() { console.info('say hello!'); } return B; }); C.js define([D], function(D){ var C={}; c.run = function() { console.info(D.name + ' free running!'); } return C; }) D.js define([],function(){ var D={'name':'songzheng'}; return D; });
<script type="text/javascript"> require(['Iris','cookie'], function(Iris, Cookie){ console.info(Iris); console.info(Cookie); }); </script>
标签:javascript amd
原文地址:http://blog.csdn.net/songzheng_741/article/details/38847589