jQuery Methods for Sending an AJAX Request

Part of the JavaScript & AJAX For Dummies Cheat Sheet

As you can see from studying the following table, jQuery supplies several methods for sending an AJAX request to the server and parsing the results.

Method Description
get(url, parameters) Send an HTTP GET request to the given URL. Parameters is JSON object encapsulating form data (name/value pairs). Result is returned as HTML, XML, or plain text data.
post(url, parameters) Just like get, but uses the post method, which hides the parameters.
load(url, parameters) Much like get(), but returns a jQuery object. Calling jQuery objects contents are replaced by the returned data (usually HTML or XHTML).
getJSON Like get, but returns a JSON object, which can be parsed for further processing.

Comments (0)

Leave a Reply


Post Comment

SERIES
JavaScript & AJAX For Dummies Cheat Sheet

Grab a free widget and we'll bring interesting & helpful tips to your favorite personal page each day

Sign Up for RSS Feeds

Computers & Software

Inside Dummies.com