New to RequireJS. Is there any way I could organize this better:
require(["jquery"], function($) {
$(function() {
$('#id').live('click',function(){
require(["mainplugin","otherplugin","thirdplugin"], function(){
$('#id').pluginName();
});
});
});
});
The rest of the plugins should only be loaded when the el is clicked.
You do not need the first
$(function() ...wrapper, as the code will be executed as soon as jquery is loaded.