Reputation: 313
Is there a problem if i build multiple jquery plugin in one file? Ex:
//first plugin
(function($){
//first plugin code goes here
})(jQuery)
//second plugin
(function($){
//second plugin code goes here
})(jQuery)
//third plugin
(function($){
//third plugin code goes here
})(jQuery)
Upvotes: 0
Views: 59
Reputation: 1034
Technically is allowed by javascript. But usually a developer always make modular code to prevent confusing for other developers. Sometimes they have to debug your code, and spaghetti codes will make the process more harder. It will be better if you made two version of your codes, the development version and the production one.
Upvotes: 1