arguments - requirejs callback parameter is undefined -
i'm starting require.js. here's simple code have in main.js
require.config({ baseurl: '/js', }); require(['lib/jquery-min'], function(jq){ console.log (jq); // returns "undefined" });
in require function above, argument jq returned empty. can me identify issue here?
answer: requirejs loading jquery when configure path option
require.config({ baseurl: '/js', paths: { jquery: 'lib/jquery-min' } }); require(['lib/jquery-min'], function(jq){ console.log (jq); // works now!!! });
Comments
Post a Comment