AJAX and Web 2.0


AJAX is hot right now. Hot enough that clients have heard of it and are starting to ask for it. What is this new thing? Well, first, it’s not that new. It just now has a name.

AJAX is a way for dynamic web pages to get changing content. We’ve had dynamic web pages for a long time with javascript. You program some javascript and you get button rollovers, changing time, form validation, etc. Pretty spiffy.
On a slightly different scale are dynamic pages with PHP or ASP. Web development came a long way with these. These allow even more control over what appears on a page, especially when it is information from a database.
These each have pros and cons. For javascript, once the page is loaded that’s it. If you haven’t programmed something in you can’t get it unless you get a new page. They also can’t do a lot of things like database connections. For scripting, you can connect to databases but it runs only when getting a page. You can’t do something like button rollovers. And if you want to get new information you have to refresh the whole page. Development has many good (and some bad) ways of using these technologies to create some great functionality on websites.

So the cool thing is that AJAX combines these aspects to all but eliminate the cons. This technology has been around for years it just now has a name and is more universal.

An AJAX page could have a drop down menu. When you choose an item on the drop down menu it creates another drop down menu. We’ve seen this before. Either the page refreshes and displays the new drop down menu or some poor programmer had to make a whole bunch of javascript that contained all the possible second drop down menus. This allowed the use of javascript to ‘create’ the second drop down. But if any information changed you had to change the javascript.

Now with AJAX you can create that second drop down dynamically by using a PHP page to call a database and pass the information to the javascript. Ta Da! Magic. Very similar to how you work with Flash and scripting/databases.
The nice aspect of this, from a client perspective, is that the online apps you create can look and function more like regular desktop apps. We have used this technique several times, mostly for small items where it makes sense. Ravenna Oil is one such site. If you look at the order online, when you choose something from the drop downs you get another set of choices. The whole second set of choices is done via AJAX and what is displayed depends on what you choose in the first drop down.

Some big projects use AJAX now. Google has Writely, Google Maps and a few others. AJAX is like any other technology we use when programming, we use it when it makes sense. When done properly, you probably won’t even know that AJAX was used.

Wikipedia on AJAX
If you are looking for an AJAX tutorial to get started, here is one.
Keep an eye on our other blog, Between the Code, as we may have an AJAX tutorial up there soon.



Leave a Reply

You must be logged in to post a comment.