Ajax - Asynchronous JavaScript and XML | Ajax development company in Delhi


Download pdf | Download ppt

Ajax is Asynchronized Javascript and XML. Ajax is not a new language, it is just a way of using older technologies to get better results. Traditionally, when user sent request for some new information, the server sent the entire page as response. This approach is the synchronous way of doing things. The disadvantages involved were high bandwidth requirement and useless load on server. By using Ajax, request is sent for data that is to be updated and not for the whole page. Now the user do not have to wait for the whole page to be loaded and user experience increase. Everything occurs behind the scene.

AJAX stands for Asynchronous JavaScript and XML. It is not a programming language rather than it is a way of using existing standards to make more interactive web applications. To understand the AJAX application let us consider the standard HTTP transaction process. Whenever the client connects to server, the client sends request to server and server sends response to the client. After that client and server close their connection. After closing connection the client renders the document and this may include running some JavaScript. In an Ajax application, the JavaScript code then communicates with the server behind the scene. This communication with the server takes place asynchronously and transparently to the user. Data is exchanged with the server without the need for page reload. This process is accomplished with a special kind of HTTP request. Ajax is something which bridges the gap between the functionality and interactivity. It is a technique for crating interactive applications. It makes the web pages interactive, increases speed and usability and better user experience.

Features of Ajax:

1. It enables in developing rich internet applications. 2. It enables dynamic web application development. 3. It improves the performance of the web application. 4. Here no plug in is required. 5. It provides real time updates.

Components of Ajax:

1. HTML and CSS for marking up and to give style to the components of the site. 2. Client side scripting language (JavaScript) for dynamic display and interact with the information presented. 3. XMLHttp request object for exchanging data asynchronously with the web servers. 4. XML for transferring data.

Ajax provides new information from server without refreshing. Here the JavaScript makes a query to the server. The server returns the XML to reformat XML in place on existing screen. Ajax is a pattern for building applications on browser. JavaScript is used to control the display of elements. It asynchronously request and retrieve data from remote servers. XML is used to send numerical or text style data to the browser. Then JavaScript is used to extract data from the XML. Then HTML and CSS is used to mark up and style the page. JavaScript manipulates this.

Issues related to Ajax:

1. User does not know that updates will occur. 2. User does not notice an update. 3. User cannot find the updated information. 4. Unexpected changes in focus.

Some pros and cons of Ajax:

Pros: 1. Ajax allows the web application to interaction with the data on the server. 2. For office style applications user’s data is stored on a reliable server accessible from any web browser. 3. It makes the web application more and more real application. Cons: 1. It is very tough to make compatible to all browsers. 2. Should have low latency connection into the server. 3. Can be server intensive. 4. Limited capabilities like multimedia and interaction with web-cams, printers and real time graphics. 5. Much waiting time for log in. 6. Problems with forward and backward buttons and bookmarks. 7. Not easy for low skilled raw developers. 8. Too many codes make the browser slow. 9. Everybody cannot do it.

Steps for setting up Ajax transaction: 1. Create an XMLHttp request object. 2. Set up the request’s on ready change function. 3. Open the request. 4. Send the request.

An Ajax transaction involves the client sending an asynchronous HTTP request and the server responding with XML. Client processes the resulting XML document tree. Ajax applications run entirely on the client except when they need to access data on the server. Ajax applications can treat the server as a database. Well written Ajax applications running with a fast internet connection can be as nice to use as traditional applications. Ajax is a broad group of technologies that can be used to implement a web application that communicates with server in the background without interfering the current state of the page. Ajax application has changed the dynamic web applications functionalities. Some popular Ajax frameworks are- JQuery, ASP.NET AJAX, Spry framework, Dojo Toolkit, angular JS etc. a PHP Ajax framework is able to deal with database, search data and build pages and publish the pages or return data to the XMLHttpRequest object. Quicknet is an Ajax framework that provides secure data transmission and uses PHP on server side. Xajax uses only XML format on server side. Sajax framework provides easy integration of function.