Javascript frameworks

I would like to get opinions on which JS framework is best for a relatively simple website. I’ve looked at extjs but it seems more focused on complex webapps than a website. Important to me will be styling, autocomplete, ajax support, basic dom manip.

You may want to click the little flag under your post to ask a moderator to move this thread over to Javascript… because I would think you’ll get answers by those using frameworks. Although I can predict a bunch of people will fly by and say “jQuery for everything bestus evar LOL” etc. Though I’m also thinking, someone surely has made a page somewhere with a breakdown of what each of the popular frameworks concentrate on as being best at… likely found in a google search.

You DO want a rather popular framework, rather than an obscure one. Popular ones are most likely to be best debugged and regularly updated.

To get effective use out of any of the frameworks you need to know a reasonable amount of JavaScript first. Once you know enough JavaScript to be able to use a framework effectively the choice of which framework will best suit you will be fairly obvious.

jQuery for AJAX and the like is top class (in my opinion). You will need jQuery UI / plugins to use more advanced features, although for simple AJAX calls it’s really rather good. It is different to other frameworks I tried in the essence it felt more like writing CSS than JavaScript, where as other frameworks (MooTools) felt like I was over my head. I did the stupid thing of picking a framework and not learning JavaScript to begin with - a big mistake. What do you need this to do? It may be simple enough to just write the JS yourself.

A lot of what I will want to do is around UI controls - auto complete, combo boxes.

I will also be doing a lot of dynamic manupilation of DOM objects - getting a list of results displaying them, sorting them, etc.

But, for instance, I’ve heard that MooTools developers consider themselves as actually extending the Javascript language itself, while jQuery is also known for concentrating on smooth animation and scrolling etc. (heard that one from Kevin Yank, don’t know it from experience).

You’ll find people who love each framework, and people who hate each framework. Really, it all comes down to personal preference – take a look at the documentation for the ones that interest you, look at the sample code, and see which one fits your style of programming the best. The one that is easiest for you to work in will be the best choice for you.

(And I must second what Adam said – knowing the core principles of JavaScript as a language is a must before you start diving into frameworks. It will save you a lot of headaches in the long run)

What you use would be dependant on exactly what you are trying to do?