Magazine
 
AJAX: Redefining Web Applications
 

When the number 4 is entered, the output looks like:

If you do not provide any value, it behaves similar as shown below:

Checking it again with number 27.

In the above servlet, we used simple StringBuffer class to create a JSON object as a response string. This response string is then parsed at the client-side by using the JavaScript’s eval() function.

The extracted data is then placed into the different UI elements of the web page.

Advantages 

• We can build rich Internet applications with AJAX.
• The interface is much more responsive. The user has the feeling that changes areinstantaneous.
• Waiting time is reduced.
• If a page section encounters an error,

 

other sections are not affected (if not logically linked) and the data already entered by the user is not lost.
• Traffic to and from the server is reduced considerably.

Disadvantages
• The web page cannot connect with the browser history engine.
• AJAX is not meant to be used in every application. One of the main reasons for this stays in the fact that search engines cannot index it. So, keeping this in mind, a much better idea than creating complete AJAX application, it would be better to scatter AJAX features within the application.
• Not all browsers (especially older ones) have complete support for JavaScript or the XMLHttpRequest object. 

Some examples of popular websites using AJAX:

• Following are some popular websites using AJAX:


• Google Suggest
• Google Maps
• GMail
• Google Reader
• Blogger
• Flickr
• YouTube
Ajax isn’t a technology: it’s a group of ideas that, used together, have proven very powerful to make the web applications more interactive, but is not meant to be used in every web application.

Nov 2007 | Java Jazz Up | 56
previous
index
next
 
View All Topics
All Pages of this Issue
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69   Download PDF