• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
WHY AJAX?
 Asynchronous JavaScript and XML commonly known as AJAX. This is not a new programming language, but a new way to use existing standards.
Why Ajax?
The only and the most important answer is that an alternative to flash. No flash so Ajax.In other words we can say AJAX has two huge benefits:1.
 
Speed and invisibility makes for a very slick user experience.2.
 
The smaller server resources footprint helps server scalability.With AJAX, Internet applications can be made richer and more user-friendly. When yourcustomer clicks on something on an Ajax driven application, there is very little lag time.The page simply displays what they're asking for.It is widely accepted that fast-loading pages improve the user experience. In recent years,many sites have started using AJAX techniques to reduce latency.
History of Ajax
The start of 2005 saw the rise of a relatively new technology, dubbed “Ajax” by JesseJames Garrett of Adaptive Path. Ajax stands for Asynchronous JavaScript and XML. In anutshell, it is the use of the nonstandard
XMLHttpRequest()
object to communicate withserver-side scripts. It can send as well as receive information in a variety of formats,includingXML, HTML,and even text files.
How does AJAX WORK?
The Ajax engine works within the Web browser (through JavaScript and the DOM) torender the Web application and handle any requests that the customer might have of theWeb server. The beauty of it is that because the Ajax engine is handling the requests, itcan hold most information in the engine itself, while allowing the interaction with theapplication and the customer to happen asynchronously and independently of anyinteraction with the server.Ajax’s most appealing characteristic, however, is its “asynchronous” nature, whichmeans it can do all of this without having to refresh the page. This allows you to updateportions of a page based upon user events and provides one of the cornerstones of RichInternet Applications (RIA) referred to in discussions of “Web 2.0.”
How AJAX is different
An Ajax application eliminates the start-stop-start-stop nature of interaction on the Webby introducing an intermediary — an Ajax engine — between the user and the server.
 
Instead of loading a webpage, at the start of the session, the browser loads an Ajax engine— written in JavaScript and usually tucked away in a hidden frame. This engine isresponsible for both rendering the interface the user sees and communicating with theserver on the user’s behalf. The Ajax engine allows the user’s interaction with theapplication to happen asynchronously — independent of communication with the server.So the user is never staring at a blank browser window and an hourglass icon, waitingaround for the server to do something.
Getting Started with AJAX
Ajax is not a technology in itself, but a term that refers to the use of a group of technologies. Ajax uses a combination of:
 
HTML and CSS for marking up and styling information.
 
The DOM accessed with JavaScript to dynamically display and interact with theinformation presented.
 
A method for exchanging data asynchronously between browser and server,therewith avoiding page reloads. The XMLHttpRequest (XHR) object is usuallyused, but sometimes an IFrame object or a dynamically added
<
script
>
tag is usedinstead.
 
A format for the data sent to the browser. Common formats include XML, pre-formatted HTML, plain text, and JSON. This data could be created dynamicallyby some form of server-side scripting.The DOM plays into Ajax in a number of ways. How you use the DOM depends a gooddeal on how you handle the content returned from the server. You can treat the content assimple text using the responseText property of the server response, or you can treat it asXML using
responseXML
. Assuming the content you pull back from the server is an (X)HTML snippet and you’ve gotten it as
responseText
, you could drop that content into aparticular spot on the page using
innerHTML
. On the flip side, if the content you pull back is XML and you’ve gotten it as
responseXML
, you can traverse its DOM, cherry-pickingor performing functions on the elements, attributes, and text nodes.Although we are just beginning to realize its full potential, the proven success of famousAJAX-based projects like Google Maps, Google suggest or gmail are few real timeexamples which signifies that this is not just another media hype, but rather a promisingtechnology that may change web-applications as we know them.
Limitation of Ajax
AJAX will not work in all web browsers. As its name suggests, AJAX requiresJavaScript. This alone means that AJAX applications will not work in web browsers anddevices that do not support JavaScript. For this reason it is not accessible to many typicalWeb users
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...