jQuery Ajax

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • var jqXHR = $.ajax( url [,settings] )
  • var jqXHR = $.ajax( [settings] )
  • jqXHR.done(function( data, textStatus, jqXHR ) {});
  • jqXHR.fail(function( jqXHR, textStatus, errorThrown ) {});
  • jqXHR.always(function( jqXHR ) {});

Parameters

ParameterDetails
urlSpecifies the URL to which the request will be sent
settingsan object containing numerous values that affect the behavior of the request
typeThe HTTP method to be used for the request
dataData to be sent by the request
successA callback function to be called if the request succeeds
errorA callback to handle error
statusCodeAn object of numeric HTTP codes and functions to be called when the response has the corresponding code
dataTypeThe type of data that you're expecting back from the server
contentTypeContent type of the data to sent to the server. Default is "application/x-www-form-urlencoded; charset=UTF-8"
contextSpecifies the context to be used inside callbacks, usually this which refers to the current target.

Remarks

AJAX stands for Asynchronous JavaScript and XML. AJAX allows a webpage to perform an asynchronous HTTP (AJAX) request to the server and receive a response, without needing to reload the entire page.



Got any jQuery Question?