jQuery and YUI (yahoo ui) jQuery and YUI (yahoo ui) jquery jquery

jQuery and YUI (yahoo ui)


jQuery

  • $ DOM selection is powerful and works like magic.

  • jQuery code is usually very concise; helper functions exist foranything trivial (and non-trivial, even).

  • The plugin library is extensive and offers quick functionality.

  • jQuery is amazing for smaller sites and it’s easy to pick up for newusers , which is why it has such a large community.

  • immediate results with less learning curve.

YUI

  • Great documentation and examples, as well as support from Yahoo withtech talks and frequent updates.

  • Code written with YUI tends to be organized. At times it even feelsJava-esque. Has a rich set of modules for things other than DOM manipulation - cookies, cache, history, i18n, etc.

  • Particularly through Gallery, YUI has gotten more open to externalcontributions

  • YUI specialy YUI3 requires at least basic skill with the language,and more if you really want to exploit it well and extend it.

  • YUI is a lot more adapted for well organized, modular code which can be reused.

To see what YUI is capable of you can visit here for examples of YUI2 , and here for YUI3 galleries(which are IMO a bit similar to JQuery plugins ) .

You can refer this site to compare YUI and jquery's speed .

IMO JQuery is a library , YUI is a framework and not a library. JQuery is good for small websites where you want to achieve a ‘WOW’ factor in relative short time. But when you are building an application, you need a robust framework where you can integrate your own codes yui is better choice.


UPDATE

The YUI framework was deprecated in August 2014


I'll leave it to the jquery pros to spell out the best comparison points, but I use YUI in projects both small and large. YUI is structured so that you only need include the modular functionality you need, down to the grainiest level, including the ability to roll your dependencies all back up into just the right package.

YUI is fantastic for DOM manipulation, io, widgets, the works really. Go with YUI3, if you find YUI2 widgets you want/need, they have 'YUI2-in-3'.

In addition, one (probably more) of YUI's core contributors, Dav Glass, has done some awesome work on getting YUI3 on the server - so you essentially have the same framework doing back end grunt work, and the same dependencies doing the front end magic.

YUI's seed inclusion system is very easy to get started with too, sample code:

<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script><script type="text/javascript">    YUI().use(['node','io'], function (Y) {        // node and io are ready now, do whatever you like. Need custom events, gesture support or animation? Add them to the array above.    });</script>

There's my case for YUI, have fun with it :)

Also, I have included both jquery and YUI on a couple of projects... I didn't notice anything detrimental, but with more YUI experience, I haven't needed to do that again.


Don't use both libraries, your pages will load slower :)

jQuery is mostly for DOM manipulation and AJAX and works well with web pages/sites. YUI is more of a framework and works well with web applications. Although there is some cross-over; YUI can be used easily with smaller trivial sites and jQuery can be used to create large web apps (although usually it is combined with something else like Backbone or JavaScriptMVC for better code organisation)

If one doesn't give you all you need, use a different one