I am new to require js, and the problem is I don\'t really understand how to load jQuery plugins.
I would like to load multiple plugins but I already have problems w
Hi I will like to tell you here that if you want to include non AMD scripts (which do not include define() call) , we use shim config . I will like to explain with a simple example of jquery hightlight plugin.
this will be your config file where you define all paths
paths:{
"jquery":"/path/to/jquery",
"jgHighlight":"/path/to/jquery.highlight"
},
shim:{
deps:["jquery"], // jquery.highlight dependeps on jquery so it will load after jquery has been loaded
exports:"jqHighlight"
}
Now in a module which starts with define , include jqHighlight like this
define(["requireModulesArray","jgHighlight"],function(requiredModulesAliasArray){
// no need to include any alias for jgHighlight in function(...)
//use it like this now
$("#divT").highlight("someText");
});
Similarly other non amd modules will be included and used. Thanks