INTRODUCTION TO AJAX Presented By : Shatakshi Agarwal
CONTENT What is AJAX ? Bases of AJAX How Ajax work ? Pros & Cons
What is Ajax ? Ajax is a set of Web development techniques using many Web technologies on the client side to create asynchronous Web applications. Microsoft invented Ajax in 1999 . AJAX is an acronym for A synchronous J avaScript A nd X ML . AJAX is not any new programming language, but simply a new technique for creating better, faster, and more interactive web applications.
AJAX uses JavaScript to send and receive data between a web browser and a web server. The best example of AJAX implementation is Yahoo mails. AJAX applications can only run in web browsers with complete XML support. Internet Explorer (IE) and Mozilla Firefox have complete enough support for XML to run AJAX applications.
Diagram :-
Bases of AJAX AJAX is very simple technology based on the following open standards : JavaScript XML HTML CSS
The open standards used in AJAX are supported by all major browsers. AJAX applications are browser and platform independent. You can say it is a Cross-Platform and Cross-Browser technology at the same time. A traditional web application usually submits its input (using an HTML form) to a web server. After the web server has processed the data/request, it will return a completely new web page to the user’s browser. Because the server returns a new web page each time the user submits input, traditional web applications often run slowly and to be less user friendly.
With AJAX, web applications can send and retrieve data without reloading the whole web page. This is done by sending HTTP requests to the server (behind the scenes), and by modifying only parts of the web page using JavaScript when the server returns data. The back bone of the AJAX technology is : the XMLHttpRequest object. To create AJAX web applications, you have to become familiar with the JavaScript object called the XMLHttpRequest .
The XMLHttpRequest The XMLHttpRequest object is the key to AJAX. It has been available ever since Internet Explorer 5.5 was released, but not fully discovered before people started to talk about AJAX and Web 2.0 in 2005.
PROS Speed is enhanced as there is no need to reload the page again. AJAX make asynchronous calls to a web server, this means client browsers avoid waiting for all the data to arrive before starting. Form validation can be done successfully through it. More interactive.
CONS Ajax is dependent on Javascript . If there is some Javascript problem with the browser or in the OS, Ajax will not support . Source code written in AJAX is easily human readable. There will be some security issues in Ajax . Problem with browser back button when using AJAX enabled pages.