Reputation: 3414
I'n trying to check jquery load in my project that is loaded or not. But i want to do this in my require.config. I set shim setting like;
require.config({
'paths': {
'jquery': !window.jQuery ? '../Libraries/jquery-1.10.1.min' : window.jQuery,
'jqueryui': '../Libraries/jquery-ui-1.10.0.custom',
'underscore': '../Libraries/underscore-1.4.4',
'mousetrap': '../Libraries/mousetrap-1.4.0'
},
shim: {
'underscore': {
exports: 'under'
},
'jqueryui': ['jquery'],
'mousetrap': ["jquery"]
}
});
But it's giving error. Require.js is trying get link from function. Can i check jquery in config? Or Should i use another way?
Btw. Error; Uncaught Error: Script error http://requirejs.org/docs/errors.html#scripterror require-2.1.5.js:159
Thanks
Upvotes: 1
Views: 609
Reputation: 1401
Please Checkout this http://blog.falafel.com/blogs/basem-emara/2013/03/01/how-to-avoid-loading-jquery-twice-with-requirejs. It might help.
Upvotes: 3