Implementing Low-Level AJAX Requests

$.ajax({   url:"setEmail",   type:"get",   accepts:"json",   contentType: 'application/x-www-form-urlencoded; charset=UTF-8',   data: {"first":"Brad", "last":"Dayley"} }).fail(function(){ alert("request Failed"); });

All AJAX request wrapper methods that you have been working with in his chapter are handled underneath through the .ajax(url [, settings]) interface. This interface is a bit more difficult to use, but it gives you much more flexibility and control of the AJAX request.

The .ajax() method is called the same way that .get() and .post() are, but the settings argument allows you to set a wide variety of settings when making the request.

Table 13.3 lists the more common ...

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.