See title...
views:
1469answers:
23Ext-js has some great UI controls, but it isn't free. jQuery seems to have a good strong userbase (not sure if that's so important tho).
It's a matter of personal preference obviously, but I found jQuery to be the easiest to use and deploy and it has a very powerful API.
You will get a million answers here. The short one is: there are several, not a single one. They are all different in some ways and similar in others, and, in general, none of them are poor choices. The main frameworks that I would recommend are (in alphabetical order so as not to show any bias):
- Dojo
- jQuery
- MooTools
- Prototype (with Scriptaculous)
- YUI
- MochiKit
Each of these have different styles, different communities, and different focuses. Which one you should choose is mostly a matter of matching these frameworks' style with your own. Spend some time with the tutorials and demos of each and pick the one that makes the most sense for you.
As a disclaimer, I'll point out that I'm a developer for MooTools, and wrote a book on how to use it. I wouldn't say that MooTools is better than any of these other frameworks; only different.
That depends. Dojo and jQuery are good answers, but I think the two solve different needs. jQuery is an extremely useful tool for manipulating the DOM in easy to read, quick, and powerful ways. Dojo is more of a robust set of tools (hence why it is a toolkit not a library/framework) and gives you widgets, built-in regex validations, AJAX support, all sorts of great stuff too numerous to name them all.
There is some overlap between the two, surely, but I think ultimately they seek to serve two different needs.
YUI is very complete but tends to be large (Container scripts tend to be almost 40k when compressed!). But it does let you do sliders, fades and containers with less lines of code than other libraries provided you don't mind it looking like a YUI app out of the box.
Personally, I'd suggest going with something smaller (jQuery, prototype) and doing more of the grunt work yourself if you have the time as you don't end up with as much crud as you might otherwise
Dojo has the best widget system IMO.
Dojo has a great build system that compresses all your CSS and JS, is ARIA compliant, and has a great widget system that you can use to make your own widgets quickly and easily.
Ext is good too, but you're going to have a licensing nightmare if you use it in a corporate environment.
Extjs is the richest of the ones I've used. The API documentation is extensive and well done. Extjs actually uses jsquery or prototype or yui at a lower level. (It works with all three).
Extjs has a very desktop-like orientation to web-app development. Windows, panels, components, etc. Lots widgets likes grids and progressbars and sliders are built it. For better or worse, working with Extjs feels much more like desktop app development than any other js libraries.
It's also commercial -- not OSS.
It's a pretty fat library. The js includes for all the extjs libraries are about a meg to download for users.
One more vote for jQuery. It is very small, very fast and very logical (assuming you know your way with CSS selectors). It is build on the sound idea - get stuff, do something to stuff. If you haven't try it before - do that now.
Jquery is stable and has many examples. I know it's been mentioned, but I'll give it another vote.
JQuery man! JQuery is not only a great JavaScript library but the AJAX API provided in the JQuery is also pretty decent.
If the focus is on "rich internet applications" then jQuery alone won't get you very far. It is an excellent library, but "applications" (vague-quotes, not scare-quotes) tend to require things like undo commands. MVC is also popular as a GUI application design, but the support in jQuery is non-existant. Not to begrudge jQuery, it's just not designed for this.
YUI is a very nice (and well documented!) set of widgets, but is also not a an MVC stack.
The playing field is much smaller in terms of Javascript MVC frameworks. One of which is Javascript MVC, in fact.
At work we're building a thick JS client, and we just took a look at ExtJS, YUI, JavascriptMVC, Cappuccino, and SproutCore. Of those, the serious contenders were JavascriptMVC+YUI+EJS+LotsOfCustomCode or SproutCore+YUI+CustomCode. They actually complemented each other well: JavascriptMVC's weaknesses were SproutCore's strengths, and vice versa.
It pains me to use the metaphor, but JavascriptMVC is coding-to-the-metal compared to SproutCore. It was trivial to get it to do trivial things, and YUI/EJS integration is a snap. SproutCore brings us something we didn't know we could get in a package we can live with: KVO bindings (ripped straight from Cocoa), and a bunch of other Cocoa goodness besides.
The thing about bindings is that they have to be in from the beginning or they're never going to work right, and they're not in JavascriptMVC, and we can't port them without writing our own framework. And bindings are really, really slick. If SproutCore had an InterfaceBuilder, and decent documentation, it would change the web almost overnight. Not to hype the hell out of it or anything.
The crushing reality is that actually using it is a bit painful. When bindings go wrong, you're standing on a ravioli noodle trying to get to another one without crossing any of the boiling water: you just can't get there from here. I hope you're comfortable with grep, and even that'll only get you so far. This is nothing tools can't overcome, but those tools don't exist right now.
Documentation in the MVC frameworks, alas, is not a reasonable discriminator in this arena. It's all terrible, everywhere you look. But to be fair, these are all very young frameworks, and, much as i might pray, there's still no Documentation Fairy.
I voted Anutron's answers up as the best; but register my vote also for jQuery.
I prefer MooTools. I think MooTools-based Javascript is the easiest to read and maintain. It's structured, and as close to OOP you can get with Javascript, I think.
Working with scopes in MooTools is a dream compared to standard JS.
If you're looking for a good arsenal of ready-to-use scripts though, I'd probably go with jQuery, for it's large community (just look at all these jQuery votes/comments :). If you're writing something from scratch, and isn't depending on others work, MooTools :)
Duplicate with http://stackoverflow.com/questions/913/what-javascript-library-would-you-choose-for-a-new-project-and-why
I use Qooxdoo, I like it :) It has good set of widgets, and it is still emerging...
I had a look at the other answers and noticed that no one had mentioned GWT yet. GWT takes a different approach by having the source code in a subset of the Java language and then compiling it to Javascript to run on the browser.
Pros
- It compiles different browser versions of its Javascript files leading to excellent cross browser compatibility.
- Internationalization is built in.
- The widget library is impressive, especially for "application" style interfaces.
- The source code is written in Java so that things like automated unit tests, debugging and type checking are possible.
- There is integration with other Javascript libraries so you can use GWT with other things if required.
- GUI designers exist.
Cons
- The source code is written in Java. If you are not used to Java this can be a hurdle.
- The RPC mechanism back to the server, whilst being server agnostic, can be a little hard to understand, especially for non Java servers.
We have a UI written in Dojo with custom widgets and we are also prototyping a GWT replacement. Overall the process of implementing a custom widget in GWT beats Dojo hands down.
I things JQuery is amazing for smaller projects and the like, but Dojo is amazing for everything else. I can't recomend prototype or mootools at all because of the way they add to or mess with too many things in the global namespace. ExtJS was great until they commercialized it, I was going to start contributing, but they closed it up. :(
So in the end, Dojo all the way.
With my whole heart, I have to say -- There is NOTHING ELSE like SproutCore out there.
SproutCore is a fantastic framework for building GUIs. Not "web pages", but GUIs. It just happens to be written completely in Javascript, but it is much more like GUI frameworks such as Cocoa, Swing, etc.
And it is fabulously well done. Its code is beautiful. It's View class hierarchy is very well-factored, so that when you need to create a custom view (aka, "control", conceptually), you will most likely find that you can inherit from a base class and make great use of what's already there, and express only the differences in your class.
It has intelligence about what appears on the screen where so it can only update, for example, the 3rd and the 7th row of a grid (if those are the only 2 rows that changed). And it has so much more I don't have room to go into here.
It truly is a "guerilla" tool, in that it puts such great expressive power in your hands, that one developer could take over and manage a UI that previously required 10 developers.