Sunday, August 10, 2008

AJAX - What javascript can do..

AJAX is asynchronous javascript and XML. AJAX in it raw form is difficult to build rich applications. Many frameworks are developed hence. As javascript is object oriented, building a framework on it is easy. Something like a JDK with packages can be built and maintained easily.. Though AJAX was for XML, HTTP responses and JSON(kind of protocol) are supported. The following are in the market:
  1. GWT -by google. Java to javascript compiler makes it easy for java developer.
  2. Zk -very powerful and simple.
  3. DWR -simple
  4. Dojo - Excellent.
  5. Yahoo kit - dont know
  6. Ext JS
  7. Jquery
  8. More.....
Setting up the environment for these AJAX development is always a pain. Will write more in future on this. Links: Excellent gwt components here : http://www.gwt-ext.com/demo Jquery slider for select boxes : http://www.filamentgroup.com/lab/progressive_enhancement_convert_select_box_to_accessible_jquery_ui_slider/
This guy is 12 yr old.. and he knows so much of  jquery :
http://uk.youtube.com/watch?v=8mwKq7_JlS8

jquery with jsp
http://www.infoq.com/articles/First-Cup-Web-2.0-Joel-Confino

Automatic form post jquery plugin:

http://malsup.com/jquery/form/

Yes it is infact simple (include a javascript into ur existing page and
you start playing with Jquery), light weight(core is just 20KB),
pluggable/ extensible(thousands of plugins) and easy to use (implicit
event handling, expression evaluation and function chaining).





Also its jquery-form plugin( http://malsup.com/jquery/form/ )  makes
things much more easier. This takes care of marshalling the HTML input
fields automatically at the browser end.



There is some work done already on (spring MVC  + jquery) http://www.infoq.com/articles/First-Cup-Web-2.0-Joel-Confino

Tried a prototype using this and actually it works well with Xstream and Jettison mapped driver .

Also converting the existing spring MVC controller to have AJAX
capability is just a matter of setting a custom Json View instead of
Velocity view.



Data can be transferred from browser to server in either of the format:

JSON(Java script object notation) or XML.

   JSON is simple as it gives you a java like object graph and is more popular in open source community.      

   However it lacks XML flexibility (like having attributes,etc)



Obviously, having an IDE for jQuery would make development easier
especially with code completion  and debugging capabilities. There are
few of them to evaluate - Aptana and Spket IDE.

Jquery Editor:
http://spket.com/jquery.html

No comments: