Ajax( Asynchronous JavaScript And XML) is used to create asynchronous web applications. It is deployed on the client-side and makes use of several web technologies. Ajax has made it easier to asynchronously send and retrieve data from a server without interfering with the existing page’s display and functionality.
Ajax is not a programming language, and it requires a built-in browser with the XMLHttpRequest object, which requests data from the server.
Ajax also uses JavaScript and HTML DOM to display the data.
The jQuery library has a full suite of Ajax capabilities. These methods allow a user to load data from the server without refreshing the browser. The following is a list of such Ajax capabilities:
.ajaxComplete()
:
Registers a handler to be called when the Ajax requests are complete. This is an AjaxEvent.
.ajaxError()
:
Registers a handler to be called when the Ajax requests complete with an error. This is an Ajax Event.
.ajaxSend()
:
Attaches a function to be executed before an Ajax request is sent. This is an Ajax Event.
.ajaxStart()
:
Registers a handler to be called when the first Ajax request begins. This is an Ajax Event.
.ajaxStop()
:
Registers a handler to be called when all Ajax requests have been completed. This is an Ajax Event.
.ajaxSuccess()
:
Attaches the function to be executed whenever an Ajax request completes successfully. This is an Ajax Event.
jQuery.ajax()
:
Performs an asynchronous HTTP (Ajax) request.
jQuery.ajaxPrefilter()
:
Handles custom Ajax options or modify existing options before each request is sent and processed by $.ajax().
jQuery.ajaxSetup()
:
Sets default values for future Ajax requests.
Its use is not recommended.
jQuery.ajaxTransport()
:
Creates an object that handles the actual transmission of Ajax data.
jQuery.get()
:
Loads data from the server using an HTTP GET request.
jQuery.getJSON()
:
Loads JSON-encoded data from the server using a GET HTTP request.
jQuery.getScript()
:
Loads a JavaScript file from the server using a GET HTTP request, then execute it.
jQuery.param()
:
Creates a serialized representation of an array, a plain object, or a jQuery object suitable for use in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input elements with name/value properties.
jQuery.post()
:
Sends data to the server using an HTTP POST request.
.load()
:
Loads data from the server and places the returned HTML into the matched elements.
.serialize()
:
Encodes a set of form elements as a string for submission.
.serializeArray()
:
Encodes a set of form elements as an array of names and values.
Free Resources