jQuery and AJAX

The jQuery framework includes methods that make writing Asynchronous JavaScript (AJAX) much easier. These methods are used to call a service on the server and receive the results (typically as a JSON message or an HTML partial view). You then use these results to update sections of your page.

The jQuery AJAX methods are key components of building applications that are perceived as responsive to the user’s eyes. A lot of your code has to execute on the server to get data, save results, and more. Typically, this means page refresh. With AJAX, you do not need to refresh an entire page on post. Instead, it can simply update a portion of the page much like a native application.

Writing and calling services are covered in Chapter 19, “Building and Consuming Services with Web API and WCF.” jQuery is used throughout that chapter. The subsection “Use jQuery to Create a New Customer” covers the jQuery AJAX methods of $.get(), $().post, $.getJson(), and $.ajax(). You may want to scan that section of the chapter before continuing. Some of the techniques discussed in Chapter 19 are used throughout the rest of this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset