jQuery Ajax Methods

About This Index
This page is the jQuery Ajax index for the tutorial track. Each row links to a full guide with syntax, examples, and FAQs.
Learn the jQuery overview on /jquery. Use this page when you need an Ajax API such as $.ajax(), $.get(), or .load().
Start with $.ajax(), then $.get() / $.post(), then .load() and $.param()—add ajaxStart / ajaxStop when you need a shared spinner.
How to Call an Ajax Method
Use $.ajax() for full control, or a shorthand—chain done() / fail() on the returned jqXHR:
$.ajax({
url: "/api/users",
method: "GET",
dataType: "json"
}).done(function (data) {
console.log(data);
}).fail(function (xhr) {
console.error(xhr.status);
});
$.get("/api/users", function (data) { /* … */ });
$.post("/api/users", { name: "Ada" });
$.getJSON("/api/users.json");
$("#panel").load("/partials/card.html");
$.param({ a: 1, b: [2, 3] }); // "a=1&b[]=2&b[]=3" jQuery Ajax Methods Table
All Ajax method and event guides in this jQuery tutorial series (24 tutorials).
Core Ajax API
4 methodsMake HTTP requests with $.ajax() — the foundation behind $.get(), $.post(), and .load().
| Method | Description | Tutorial |
|---|---|---|
$.ajax() | Core Ajax call — configure URL, method, data, and dataType, then chain done(), fail(), and always() on jqXHR. | Try it |
$.ajaxPrefilter() | Hook that runs before each $.ajax() — tweak options, abort duplicates, or filter by dataType. | Try it |
$.ajaxSetup() | Set default Ajax options for later requests — prefer explicit options or a wrapper in new code. | Try it |
$.ajaxTransport() | Register a custom send/abort transport — advanced path for non-standard dataTypes. | Try it |
Ajax Shorthands
5 methodsOne-line helpers built on $.ajax() — GET, POST, JSON, script, and HTML injection.
| Method | Description | Tutorial |
|---|---|---|
$.get() | GET shorthand for $.ajax() — pass url, optional data, success callback, and dataType. | Try it |
$.post() | POST shorthand for $.ajax() — send body data with url, data, success, and dataType. | Try it |
$.getJSON() | GET JSON shorthand — dataType json is preset so the success callback receives parsed data. | Try it |
$.getScript() | GET script shorthand — load and run a remote .js file (dataType script). | Try it |
.load() | Fetch HTML and inject it into matched elements — optional fragment selector after a space in the URL. | Try it |
Ajax Utilities
3 methodsSerialize data for query strings and request bodies before you call Ajax.
| Method | Description | Tutorial |
|---|---|---|
$.param() | Serialize objects, arrays, or form fields into a URL-encoded query string for Ajax or GET URLs. | Try it |
.serialize() | Encode successful form controls as a query string — ready for $.post() or $.ajax(). | Try it |
.serializeArray() | Encode form controls as [{ name, value }, ...] — map or filter, then pass to $.param(). | Try it |
Global Ajax Events
12 methodsWatch every qualifying request from one $(document) handler — start, send, success, error, complete, stop.
| Method | Description | Tutorial |
|---|---|---|
ajaxStart | Document event when the first global Ajax request begins — pair with ajaxStop for a spinner. | Try it |
.ajaxStart() | Legacy shorthand for binding ajaxStart — prefer $(document).on('ajaxStart', fn). | Try it |
ajaxSend | Document event that runs before each global Ajax request is sent. | Try it |
.ajaxSend() | Legacy shorthand for binding ajaxSend — prefer $(document).on('ajaxSend', fn). | Try it |
ajaxError | Document event when any global Ajax request finishes with an error. | Try it |
.ajaxError() | Legacy shorthand for binding ajaxError — prefer $(document).on('ajaxError', fn). | Try it |
ajaxSuccess | Document event when any global Ajax request completes successfully. | Try it |
.ajaxSuccess() | Legacy shorthand for binding ajaxSuccess — prefer $(document).on('ajaxSuccess', fn). | Try it |
ajaxComplete | Document event when any global Ajax request finishes — success or error. | Try it |
.ajaxComplete() | Legacy shorthand for binding ajaxComplete — prefer $(document).on('ajaxComplete', fn). | Try it |
ajaxStop | Document event when the last global Ajax request completes — hide loading UI here. | Try it |
.ajaxStop() | Legacy shorthand for binding ajaxStop — prefer $(document).on('ajaxStop', fn). | Try it |
Frequently Asked Questions
Start with $.ajax()
Open the core Ajax guide—syntax, examples, and FAQs.
CODETOFUN NEWS
Stay Ahead in Tech
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
16 people found this page helpful
