Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I just need to know is it safe to use jQuery and MooTools Together in one web framework?

I am not trying create application using both of them, but I am in a situation where I need to modify mootool based application framework, so I am used to jquery, I don't want to waste my time learning mootools and I think jquery is better than the mootools in many contexts like number of applications, plugins etc.

so questions are

  1. is it safe to use mootools and jquery in one framework?
  2. will there be cross browser issues?
  3. how robust the application will be when using both?
share|improve this question

2 Answers 2

Yes, you can use them in one web application.

MooTools is a compact, modular, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API.

While, jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

Thus, if you may use them both. The choice of framework depends on the development style you’re after. If you’d like to quickly get something off the ground, jQuery is the way to go. If you want to “write Javascript” and extend its power, either MooTools or Prototype would be a better choice.

share|improve this answer

You can use them both together as they both have no conflict modes, but you shouldn't. While there are some major differences in coding philosophy between the two, there is also a lot of overlapping functionality. Pick one and use it.

If you're thinking of using both because of one or two plugins, do some more searching. Most plugins in one will have been ported across to the other. If you can't find something that works, you should invest the time to learn JavaScript better so that you can port it yourself. It simply isn't worth it in terms of page weight to include both frameworks.

To learn more about the differences between the two frameworks, check out jQuery vs MooTools.

To specifically answer your questions:

  1. Yes, theoretically if you use the noconflict modes for each framework, there shouldn't be any conflicts. But no, it's not recommended to use them together because of duplicated functionality and the enormous page size.
  2. There are always cross-browser issues with any JavaScript framework, especially because new browser versions are constantly being released. MooTools and jQuery both do an excellent job of staying on top of the browser issues, but that doesn't mean either of them solves every problem you might run into. However, I don't know of any browser issues that would result as an incompatibility between the two frameworks.
  3. Your application would be less robust. You would have more points of failure, a larger page size, and debugging would be more difficult. Maintenance would be harder and you would have to have programmers experienced in both frameworks. A JavaScript framework isn't like a patch that you can put on a leaky roof, where more patches would allow less water inside. You're trying to mix slate and cedar shingles. Both work fine on their own, but they don't make much sense used together.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.