0

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)
2
  • hopefully there should be no problem Commented Apr 4, 2014 at 9:25
  • that's exactly how jquery UI is built. that's why you only download one file with all the plugins. Commented Apr 4, 2014 at 9:28

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.