--- title: jQuery Ajax Get Method --- ## jQuery Ajax Get Method Sends an asynchronous http GET request to load data from the server. Its general form is: ```javascript jQuery.get( url [, data ] [, success ] [, dataType ] ) ``` * `url`: The only mandatory parameter. This string contains the address to which to send the request. The returned data will be ignored if no other parameter is specified. * `data`: A plain object or string sent to the server with the request. * `success`: A callback function executed if the request succeeds. It takes as an argument the returned data. It is also passed the text status of the response. * `dataType`: The type of data expected from the server. The default is Intelligent Guess (xml, json, script, text, html). If this parameter is provided, the success callback also must be provided. #### Examples Request `resource.json` from the server, send additional data, and ignore the returned result: ```javascript $.get('http://example.com/resource.json', {category:'client', type:'premium'}); ``` Request `resource.json` from the server, send additional data, and handle the returned response (json format): ```javascript $.get('http://example.com/resource.json', {category:'client', type:'premium'}, function(response) { alert("success"); $("#mypar").html(response.amount); }); ``` The above example can also be written as: ```javascript $.get('http://example.com/resource.json', {category:'client', type:'premium'}) .done(function(response) { alert("success"); $("#mypar").html(response.amount); }); ``` ### jQuery.ajax() `$.get( url [, data ] [, success ] [, dataType ] )` is a shorthand Ajax function, equivalent to: ```javascript $.ajax({ url: url, data: data, success: success, dataType: dataType }); ``` `$.ajax()` provides plenty of additional options, all of which are located here. #### More Information: For more information, please visit the official jQuery.get website.