vkinfotek

AJAX - A Tool for the programming world.

Ajax is a technique for creating interactive web applications. Ajax makes it possible to create web pages which are responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user makes a change. This is meant to increase the web page's interactivity, speed, and usability.
working of ASP.Net Ajax application

How do AJAX applications work? How do you create an AJAX application? How do you convert Asp.Net applications in to AJAX enbaled applications? This book AJAX Programming gives you all the steps of developing AJAX application.

Ajax uses a combination of:
  1. XHTML, CSS.
  2. The DOM accessed with a client-side scripting language, especially ECMAScript implementations such as JavaScript and JScript.
  3. The XMLHttpRequest object to exchange data asynchronously with the web server. In some Ajax frameworks and in certain situations, an IFrame object is used instead of the XMLHttpRequest object to exchange data with the web server.
  4. XML is sometimes used as the format for transferring data between the server and client, although any format will work, including preformatted HTML, plain text, JSON and even EBML.
Technologies that enable Ajax started with Microsoft's initiatives in developing Remote Scripting. Microsoft's Remote Scripting was an elegant replacement for many other techniques, with data being pulled in by a Java applet with which the client side could communicate using JavaScript. This technique worked on both Internet Explorer version 4 and Netscape Navigator version 4 onwards. Microsoft then created the XMLHttpRequest object in Internet Explorer version 5 and first took advantage of these techniques using XmlHttpRequest in Outlook Exchange.

Leveraging Microsoft's browser's asynchronous communications capabilities, in 2001, General Interface released its JavaScript application framework for creating Web applications that look, feel and perform like desktop GUIs and communicate with HTTP based data services aligned with the growing trend in enterprise IT environments toward XML and SOAP Web services.

The Web development community, first collaborating via the microsoft.public.scripting.remote newsgroup and later through blog aggregation, subsequently developed a range of techniques for remote scripting in order to enable consistent results across different browsers. In 2002, a user-community modification to Microsoft Remote Scripting was made to replace the Java applet with XMLHttpRequest. Microsoft Callbacks in ASP.NET are the recent improvisations.

Since XMLHttpRequest is now implemented across the majority of browsers in use, alternative techniques are used infrequently. However, they are still used where wide compatibility, small implementation, or cross-site access are required.

Let us see how Ajax Performs on Major Performance Criteria.

Usability

A major drawback of Ajax is the use of Back Button. Users expect that clicking the back button in web applications will move to their last page loaded, and in Ajax applications this is not the case. Developers have implemented various solutions to this problem, most of which revolve around creating or using invisible IFRAMEs to invoke changes that populate the history used by a browser's back button. Google Maps, overcomes this by performing searches in an invisible IFRAME and then pull results back into an element on the visible web page.

A related issue is that dynamic web page updates make it difficult for a user to bookmark a particular state of the application. Solutions to this problem use the URL fragment identifier to keep track of, and allow users to return to the application in a given state. This is possible because many browsers allow JavaScript to update the fragment identifier of the URL dynamically, so that Ajax applications can maintain it as the user changes the application's state. This solution also improves back-button support.

Response-time

The interval between user request and server response, needs to be considered carefully during development using AJAX. Without clear feedback to the user, smart preloading of data and proper handling of the XMLHttpRequest object, users might experience delay in the interface of the web application. The use of visual feedback to alert the user of background activity and/or preloading of content and data are often suggested solutions to response time issues.

JavaScript

To run Ajax, no browser plug-in is required. However, it requires JavaScript enabled browsers. Microsoft Internet Explorer 6 and below require ActiveX to be enabled, as the XMLHTTP object is implemented with ActiveX in this browser.

Ajax applications must be tested rigorously to deal with the quirks of different browsers and platforms. A number of programming libraries are available. Likewise, techniques have been developed to assist in designing applications which offer alternative functionality for users without JavaScript enabled.

Accessibility

Using Ajax technologies in web applications requires strict adherence to WAI accessibility guidelines. Because of this, developers need to provide fallback options for users on other platforms or browsers, as most methods of Ajax implementation rely on features only present in desktop graphical browsers.

Web developers use Ajax in some instances to provide content only to specific portions of a web page, allowing data manipulation without incurring the cost of re-rendering the entire page in the web browser.

Interactivity

Ajax applications are mainly executed on the user's machine, by manipulating the current page within their browser using document object model methods. Ajax can be used for a multitude of tasks such as updating or deleting records, expanding web forms and returning simple search queries all without the requirement to fetch a full page of HTML each time a change is made. Generally only small requests are required to be sent to the server, and relatively short responses are sent back. This permits the development of more interactive applications featuring more responsive user interfaces due to the use of DHTML techniques.

While the Ajax platform is more restricted than the Java platform, current Ajax applications effectively fill part of the one-time niche of Java applets: extending the browser with lightweight mini-applications.

Authorship
By Bharati Karedla