Chapter 6. Ajax Libraries and Toolkits


When the term Ajax was first coined, many developers were surprised by the power of JavaScript. They had been using JavaScript for years but hadn't figured out that they could use it to create web applications with functionality that rivaled that of native desktop applications. That "eureka" moment led to hype, which in turn created the energy that has allowed Ajax to mature. When Ajax was getting started, developers had to build their applications without any help (as we have done in the past few chapters): they had to write all the JavaScript, parse the XML or JSON by hand, and create servlets to handle the asynchronous interaction with the client. That's no longer the case. The number of frameworks that exist now to simplify the task of creating Ajax applications is solid proof that Ajax is more than just hype: it's a valid, thriving architecture.

All I can say is, "Cool, bring it on!" As web developers, we have waited a long time to bring this functionality to our web applications. Swing developers, beware: Ajax levels the playing field.

Up until now, we've been building our Ajax applications with XMLHttpRequest. We have used XMLHttpRequest to send requests to the server, and we have set up callback methods to intercept the responses coming back from the server.

We can make that portion of our code more resilient by using libraries. An Ajax toolkit or library can help us build the request object and set up the callback function. Using a toolkit also eliminates one of the ugliest parts of our JavaScript code: the separate code we have to write to handle Internet Explorer and the other browsers.

This chapter will introduce the following Ajax libraries:

  • The Dojo Toolkit

  • The Rico Toolkit

  • The DWR Toolkit

  • Scriptaculous

  • Prototype




Ajax on Java
Ajax on Java
ISBN: 0596101872
EAN: 2147483647
Year: 2007
Pages: 78

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net