Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

Henrique Voni
Henrique Voni
12,296 Points

When to use JQuery different libraries?

I've seen many different JQuery libraries like JQueryUI, JQuery Mobile, etc...

Is there a specific reason to use this libraries instead of a more complete framework like CSS Bootstrap?

Thanks a lot.

4 Answers

It all depends on what your project is. The short answer is you need to look at the descriptions of each offering, and then really dig into what it does and how it does it before you can decide what is best for your needs.

For example jQuery Mobile and Bootstrap sound like they serve similar purposes by their taglines, but there are some significant differences. jQM has some nice integration with the larger jQuery ecosystem that makes using other plugins very simple, but it has many complaints about slow performance on mobile devices and its UI elements look almost comical on desktop sized screens, whereas Bootstrap accomplishes much of the same effect with CSS and has more responsive utility out of the box, but can come with a lot of bloat in the code that you might not need.

Libraries, frameworks, plugins, etc. are all terms that aren't always applied in the way they should be. The only way you're going to know what works with what, and what will be better than another is to investigate the specific offerings.

Steven Parker
Steven Parker
216,149 Points

JQueryUI is pretty complete also. But sites built with it have a different look from ones using Bootstrap. So sometimes a library choice is a design decision.

Other times you might choose a library because it provides a particular capability you need, and perhaps one not already contained in a framework you may be using.

So the two major reasons to choose a library are "how it looks" and "what it does".

Happy coding!   -sp:sparkles:

Henrique Voni
Henrique Voni
12,296 Points

Guys, i cant decide for a Best Answer... you both have nice arguments! Thanks for the help.

Henrique Voni ,

it's simple. they each have different purposes, though they all are contributed to under the jQuery open source library project.

• use jQuery in your <script> tags when you prefer to write some or all of your JavaScript code in the jQuery syntax, usually for its expediency in accessing/modifying the DOM for the web site.

• use jQuery with jQuery UI when you want to do special animations or decorations that are pre-rolled in that library on your web site, like animating sliding in different elements with different forms and speeds of easing, etc.

• use jQuery Mobile on vanilla HTML/CSS/JavaScript, or jQuery, or jQuery with jQuery UI, when you want to make your all ready working web app work well when accessed on smaller media screens, like smart phones or tablets/iPads.

I hope that helps clear all that up for you.

best,

— faddah portland, oregon, u.s.a.