Buzzword alert! Buzzword alert! Synergisticly expedite transparent web-readiness! Buzzword alert! Buzzword alert!
Ok, now that I've got that out of the way...
Ajax, as a hot technology, I was of course interested in learning more so I created a small example application that I could build and play with a bit. I thought I'd share it with everyone so they could use it as a quick-start example for trying some of these technologies.
Show Me Some CodeHere's an example of a simple blog application that talks to a single table to display articles.
blog.jsThe Application that is delivered to the Client.
getArticle() is called and initiates an asynchronous call to the getArticle.php code. When the response comes back DOJO automatically calls the showArticle() function and passes the response data to it. The showArticle() function handles formatting the data by manipulating the HTML DOM of the page.
getArticle.phpThe code that lives on the server and responds to a given service request. This PHP code parses the HTTP request that the DOJO toolkit sends to the server. It parses the data from a JSON string into PHP objects, calls into the database and gets some values out. It then turns a PHP array into a JSON string to return to the web client.
While this example is written in PHP, there is nothing that would prevent you from writing the server component in any language. There are JSON libraries for every language you've ever heard of (and a lot that you've never even heard of). The notation itself is fairly simple (it's about 700 lines of code in PHP), so implementing it in another language should be relatively easy as well.
Consider using implementation neutral URIs for your service calls and then using something like Apache mod-rewrite to map those URIs to the proper calls in whatever language you use to implement the server code. Doing this and you should be able to completely decouple your web client from the server components.