Tuesday, February 14, 2006

ajax and json

AJAX and JSON have revived my enthusiasm for Web development. Prior to doing Web development, I did a lot of rich desktop UI work where the types of interactions you could design and code were (for the most part) limitless. Once I moved to developing for the Web, I learned how the typical interaction involves the user filling out a bunch of information, the request being sent, and then a whole new page of information appears. Each time, a whole new page must be loaded. This type of interaction is very lock-step and clumsy.

Fortunately, ECMAScript (a.k.a. JavaScript), DOM, and XMLHttpRequest change the rules of engagement for Web developers in terms of the interactions they can create. Using XMLHttpRequest and callback functions lets me create interactions that are more similiar to the rich interactions that occur in desktop applications. Now interactions can take place in different portions of the page in a more fine-grained manner. No longer must I force my users to work within the framework of a full page refresh interaction cycle.

What makes AJAX even more powerful (and fun) is the use of JavaScript Object Notation (JSON) and passing data asynchronously back to the client browser so that instantly it can be transformed into a JavaScript object. That object can then be funneled directly into the page's DOM. It's smooth. It feels more natural (or at least as natural as Web development can feel).

More Web services are offering JSON as a transport mechanism in addition to XML, recognizing the benefit of not having to parse XML when all you want to do is use the data right away in a browser. Yahoo is one such provider that supports JSON. Proven applications like Gmail are built with XMLHttpRequest and JSON.

It would be interesting to speculate on the pros and cons of AJAX, both in terms of the technological and usability implications. Others have made an attempt. Perhaps in a future post I will link to their thoughts and try to expand on them with my own.

0 Comments:

Post a Comment

<< Home