Magazine
 

AJAX: Redefining Web Applications

By Atul Shinkar

Ajax: An Introduction

• AJAX stands for Asynchronous JavaScript And XML.
• AJAX is not a new programming language, but a new way to use existing standards.
• AJAX is a type of programming made highly popular in 2005 by Google (with Google Suggest).
• With AJAX you can create better, faster, more user-friendly, and interactive web applications (just like Desktop apps).
• AJAX uses asynchronous data transfer (HTTP requests) between the browser and the web server, allowing web pages to request small bits of information from the server instead of whole pages, so no page reloads.
• The first use of the term in public was coined by Jesse James Garrett of Adaptive Path in February 2005.
• AJAX incorporates:
• Standards-based presentation using XHTML and CSS
• Dynamic display and interaction using the Document Object Model (DOM)
• Data interchange and manipulation using XML and XSLT
• Asynchronous data retrieval using
• MLHttpRequest (JavaScript object)
• JavaScript binding everything together
• Updates the web page data on the fly.
• Uses XMLHttpRequest object to communicate asynchronously with the Server. § All of today’s mainstream browsers like Internet Explorer 5.0+, Safari 1.2, Mozilla 1.0 / Firefox, Opera 8+, and Netscape 7 support the XMLHttpRequest object.












 

Web Scenario without AJAX:

• One page per request
• One URL for one page
• The whole page updates

Web Scenario with AJAX:

• Each action has a URL
• Multiple requests per page
• You control what updates

Detecting the web browser:

• In JavaScript, we use the following code to detect the type of browser, the application is dealing with:

var request;
if (window.XMLHttpRequest) {
//non-Microsoft browser
request = new XMLHttpRequest( );
} else if (window.ActiveXObject) {
//Microsoft browser
request = new
ActiveXObject(“Microsoft.XMLHTTP”);
}
AJAX Request ‘n’ Response

Nov 2007 | Java Jazz Up | 47
 
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