I

ietastflres, backend processing, legacy systems server-side systems Ajax web application model

The previous figure is the traditional model for web applications (left) compared to the AJAX model (right).

(The previous figure is from Jesse James Garrett, AJAX: A New Approach to Web Applications,

http://adaptivepath.com/ideas/essays/archives/00 03 85.php).

The previous figure shows the basic difference between traditional and AJAX-enabled applications. In traditional web applications, the client sends requests directly to the server and waits to receive the corresponding response. In AJAX-based applications, however, this is replaced by a JavaScript call to the AJAX engine instead, which sends the request asynchronously to the server. As a result, web users' interaction with the application is not interrupted and users can continue to work with the application.

The jQuery library provides many methods for working with AJAX. In this chapter, we will explore the use of the following methods:

► $.ajax(settings): This is a generic low level function that helps to create any type of AJAX request. There are a number of configuration settings that can be applied using this function to customize an AJAX call. It helps to set the type of HTTP request (GET/ POST), the URL, parameters, datatype, as well as the callback functions to execute successful/unsuccessful invocation of the AJAX call.

► $.ajaxSetup(options): This method helps to define default settings for making AJAX calls on the page. The setup is done one time and all the subsequent AJAX calls on the page are made using the default settings.

0 0

Post a comment