jQuery.get() is a GET shorthand for $.ajax() (since 1.0; settings-object form since 1.12). Pass a URL (and optional data / success / dataType). It returns a jqXHR — chain .done(), .fail(), and .always().
Syntax
Start with these common calls. Keep them short and readable.
jQuery
// Positional form
$.get(url [, data] [, success] [, dataType]);
// Settings form (1.12+)
$.get({ url: "/api/items", dataType: "json" });
// Equivalent to:
$.ajax({ url: url, data: data, success: success, dataType: dataType });
// (type is always GET)
Call
What it does
jQuery
Learn jQuery.get(): the GET shorthand for $.ajax(), url/data/success/dataType signatures, settings object since 1.12, jqXHR .done()/.fail()/.always(), dataType json, silent errors, and how it compares to $.ajax() and $.post().
Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.
Parameters
Parameter
Description
Step 1
Call $.get(url) or $.get(url, data, success, dataType).
Step 2
Or pass a settings object: $.get({ url, data, dataType }).
Step 3
Chain .done() / .fail() / .always() on the jqXHR (preferred over relying only on the success argument).
Return Value
Return Value
Description
jQuery object
Most setters and traversing helpers return the jQuery collection so you can chain more methods.
Value / undefined
Getters usually return a value from the first matched element, or undefined when nothing applies.
jQuery Examples
Example 1 — Basic Success Callback
Fetch a resource and update the page when the GET succeeds.
jQuery
$("#load").on("click", function () {
$.get("https://jsonplaceholder.typicode.com/posts/1", function (data) {
$("#result").text("Title: " + data.title);
});
});
Placeholder.null skips the data argument so "json" stays in the fourth slot.
Parse. jQuery parses the body into an object before calling success.
Fail. Invalid JSON triggers an error path (use .fail() to catch it).
Frequently Asked Questions
jQuery.get() is a shorthand for $.ajax() configured as a GET request. Pass a URL, optional data, optional success callback, and optional dataType. Since jQuery 1.12 you can also pass a settings object: $.get({ url, data, dataType }). It returns a jqXHR for .done() / .fail() / .always().
A jqXHR object — a Promise-like wrapper around the request. Chain .done(fn) for success, .fail(fn) for errors, and .always(fn) for either outcome. Call jqXHR.abort() to cancel an in-flight GET.
$.get() is sugar for $.ajax({ url, data, success, dataType }) with type GET. Use $.get() for simple reads. Use $.ajax() when you need full control: custom headers, beforeSend, global: false, or other advanced settings.
function(data, textStatus, jqXHR). data is the parsed body; textStatus is usually "success"; jqXHR is the same object $.get() returned. For JSONP / some cross-domain GETs, jqXHR and textStatus may be undefined.
Yes. On HTTP or network errors the success callback never runs, and nothing alerts you unless you chain .fail(), use .always(), or listen for the global ajaxError event. Always handle failures when the user needs feedback.
Use $.get() to read data (query params in the URL). Use $.post() to send body data — form submits, creates, and other write operations. Both are shorthands over $.ajax().