views:

489

answers:

13

Hey Everyone,

I have some experience in AJAX development, mostly on .NET and MooTools. However, I want to learn more and see what others out there thought about the various other options available. I am looking more for advise about the front end. The back end, I will most probably be coding up in .NET using c# and WCF services.

Please feel free to provide me as much information as you can. Also I would appreciate any links to resources.

List of Options (feel free to add)

  • Write my own Javascript

  • Use a frame work like MooTools, JQuery etc. Which one is better?

  • Use Google Web Toolkit. Am I tying myself to limitations of GWT? Or are there not limitations?

  • ASP.NET AJAX

  • WPF (Will this run on non IE browsers?)

  • Flash (it'll be a pain to learn action script)

Thanks Jaspreet

+8  A: 

Writing your own Javascript often means reinventing the wheel when it comes to trying to attain cross-browser compatibility. Frameworks such as jQuery and MooTools take care of much of that grunt work for you.

Personally, I would suggest picking a Javascript framework or using GWT, but really it's just a matter of personal preference at that point, much like choosing a programming language. Pick that one that is best for your purposes, or that you're most familiar with.

Marquis Wang
+1 for MooTools. Most of the time, when I don't need a really fancy site, I use jQuery. But MooTools has a pretty stellar product that really excels when you need to do fancy effects and the like.
jrista
+5  A: 

I would recommend jQuery. It's more extensible and light-weight than most other JavaScript libraries I've seen (and you can have it Google-cached with the AJAX APIs).

For Flash-based AJAX web apps, Flex is a better solution.

Quartz
+1  A: 

there is also prototype.js

動靜能量
he'll be using Asp.net and probably also some of it's ajax functionality (like it or not). Prototype's global namespace pollution is a pain when it comes to integration with anything else than... well prototype and scriptaculous...
Robert Koritnik
+6  A: 

Those will all have you working with very solid code, which is usually the best way to improve your own skills. And don't forget all their extensions/plugins.

antony.trupe
http://www.jqueryvsmootools.com/
Natrium
+3  A: 

Like other responders I prefer to use frameworks, but my favorite is dojo -- clean and well-designed architecture, good books (my favorite being Matthew Russel's), and a particularly impressive approach to using browser extensions (such as Google Gears or Microsoft Silverlight) if the user has them installed, while falling back gracefully (e.g. to Ajax-interfaced server-side storage) if no suitable browser extensions (or sufficiently advanced browsers, with HTML5 support) are present.

Dojo is, currently, slightly less popular than jquery (e.g., [jquery ajax] has 8.4 million hits on Google Search, vs 4.3 million for [dojo ajax]), but that's still way popular enough to ensure it won't go away any time soon;-).

Alex Martelli
+5  A: 

Since this is a fairly subjective question I will put in my 2 cents.

I've developed using the Dojo toolkit and found it very well rounded. However, if you don't do a custom build on your library it slows everything down. It has a steeper learning curve than other frameworks, but seems to sit pretty close to heart of Javascript.

But this isn't an advertisement for dojo. I'm working on a Ajax web app currently and my goal is to try and avoid using a framework. Why? A few reasons.

The biggest reason is complete control over the code. Not that I don't trust toolkits, I just like my custom code. I don't have any code that I don't use, and all of my abstractions are custom made for my purposes. At times I am in fact reinventing the wheel*, but its always a bit different because it's purpose built.

The other big reason is the amount of knowledge I gain. I'm confident that I could pick up any framework much faster, because of not using one for a project. I understand so much more than I did previously. Before It was more like a voodoo mystery box, and now even frameworks make more sense to me.

The fact of the matter is if you do any non-trivial javascript you will end up with a framework (or a mess). In reality it may not be the fastest way to write web apps, but it isn't all that hard with a little practice. You can be amazed at what creative things you can come up with that didn't exist before.


*Reinventing the wheel is a terrible analogy that we all use. We reinvent wheels all the time. First made of stone, then lighter wood, tires, etc... My truck doesn't have the same wheels as my sedan.

+7  A: 

I'd go with jQuery.

jQuery will be bundled with the next version of Visual Studio. Google uses jQuery. jQuery has the largest user-base of any of the frameworks out there.. And speaking of not re-inventing the wheel: jQuery also has the largest plugin-repository of any of the frameworks out there.. Including its own official UI library which is in constant development.

.. And if you're a fan of books; there's 3-4 books about the framework out currently.

Oh, yeah! Check out Douglas Crockford's website for great vanilla JavaScript tips and tricks.

Just my two cents :)

roosteronacid
As for books, "JavaScript: The Missing Manual" is a great book that show both straight JavaScript and jQuery solutions. There's only one MooTools book I know of, and it's not particularly well-reviewed.
Nosredna
+3  A: 

You must check ExtJS.

Most libraries I've seen have usable core but lack the widget/control library that will blend-in with each other. Sure you can get a vast number of controls for jQuery, but do you have the time to find out which ones have intended functionality and tweak their visual appearance to match the rest of controls? ExtJS gives you just that. Core is core. It works and it works great. But the vast selection of compatible and functionality rich controls is the main driver that will make your life easier.

I've used ExtJS with Asp.Net and WCF services and it was a really nice experience overall. You will need some time to get to know ExtJS component model to extend it even further (as you would need to do the same with other libs), but when you do, you start loving it even more.

One more thing: since MS ships jQuery with MVC it doesn't mean it's the best. It only means it's one of the best (and much better than Microsoft's in-house Ajax) but with the most relaxed open source license.

Edit: Now that Silverlight 3 has shipped it became apparent it will shake things a bit with its offline support and rich graphics support. As well as standalone desktop like web apps. Definitely something to consider...

Robert Koritnik
+2  A: 

Please note that WPF has nothing to do with ajax.

AJAX = Asynchronous javascript and xml

WPF = a windows-only UI display technology. The only option there for in-browser use is to create an Xbap. The more-suited-for-the-web counterpart is silverlight (say, like flash but from microsoft), so perhaps you should look into that as well... it's like using flash, but with familiar MS technologies.


Concerning your question about which framework to use in case of ajax: I prefer jQuery. It's short syntax and chaining allow you to reach your goals very fast in an intuitive way.

Also, GWT is a Java framework that also renders stuff on the client, as far as i know. So you would have the limitation of Java as backend language...

Tom Deleu
+2  A: 

GWT has made considerable leaps and bounds over the past 7 months. The mutiple GWT widget libraries have received a good deal of attention, and Google's work on the library has been impressive. Going GWT limits you to:

  1. Using GWT widgets
  2. Possibly becoming a GWT widget developer

The benefits include:

  1. Coding in Java
  2. Debugging in Java
  3. Skipping the parts of JavaScript that make you pull your hair out

GWT is the step past AJAX. It buries the HTML / JavaScript so that you don't need to deal with it, but also provides access in case you do want to deal with it.

Overall, you will spend less time trying to get small things working, and more time adding awesome to your application.

Kieveli
A: 

Pick a library to learn, then pick up the others--but I don't think I'd reinvent the wheel.

I picked MooTools and have picked up jQuery/Prototype since. (Picked Mootools because their site, at the time, was the only one that validated, figured clean html meant clean javascript).

Side note about MooTools: An often overlooked feature of MooTools is the download builder. You can download just enough of the framework source to get your AJAX working, and nothing else.

rpflo
+1  A: 

Try the Yahoo! User Interface Library (YUI)

Will Sheppard
A: 

There's the BBC's open source javascript library called Glow

Will Sheppard