What is the essence of AJAX? For example, I want to have a link on my page such that when a user clicks this link, some information is sent to my server without the reloading of the current page. Is that AJAX?
I was able to get this behavior by using isoframes. In more details I put a link (let's say a small image) in a small isoframe. When the user clicks this link the browser reloads only the page in the isoframe.
I do not need much. I just want to have a small link which (after clicking) sent some information to server. Let say I have a "star-image" near a message. If a user click the star (he/she likes the message) star changes the color and my server update database (to remember that user likes the message).
Like DHTML and LAMP, AJAX is not a technology in itself, but a group of technologies. AJAX uses a combination of:
- HTML and CSS for marking up and styling information.
- A method for exchanging data asynchronously between browser and server, thereby avoiding page reloads. The XMLHttpRequest (XHR) object is usually used, but sometimes an IFrame object or a dynamically added tag is used instead.
As you can see, from a pure technological point of view, there is nothing really new here. Most of AJAX parts were already there in 1994 (1999 for the
XMLHttpRequest object). The real novelty was to use these parts together as Google did with GMail (2004) and Google Maps (2005). Actually, both sites contributed heavily to the promotion of AJAX.
A picture being worth a thousand words, below a diagram that illustrates the communication between the client and the remote server, as well as the differences between the classic and the AJAX-powered applications:
For the orange part, you can do everything by hand (with the
On the server-side, some frameworks can help too (e.g. DWR or RAJAX if you are using Java), but all you need to do is basically to expose a service that returns only the required informations to partially update the page (initially as XML/XHTML - the X in AJAX - but JSON is often preferred nowadays).
The essence of AJAX is this:
Your pages can browse the web and update their own content while the user is doing other things.
XMLHttpRequest object) then use the results of those requests to modify its page (via Document Object Model manipulation).
AJAX typically involves sending HTTP requests from client to server and processing the server's response, without reloading the entire page. (Asynchronously).
Read that example and you will be pro sooner as you think!
There are plenty of options for AJAX. The two most notable (arguably) are Microsoft's ASP.NET AJAX (formerly Atlas) and jQuery.
If you're interested, IBM have a 10 (possibly more) part series on Ajax: Mastering Ajax part 1
Although a few years old now it's a good intro, (even if you just read the first part!)
I think the whole series should be listed Here, although the site's being a bit slow for me at the moment...
©2020 All rights reserved.