2012-08-06 40 views

回答

3

由於taken from the API,你可以回調添加到主requirejs功能:

requirejs(['jquery', 'canvas', 'app/sub'], callMe); // the second parameter is the callback 

function callMe($, canvas, sub) { 
    console.log('everything is loaded'); 
    // the libraries are now available as parameters in the same sequence as in the array 
    console.log('loaded', $, canvas, sub); 
}