What is the syntax of POST() method in jQuery?

Following is the syntax of ajax post jQuery method:

$.post( url, [data], [callback function], [type] )
Where,
URL is a string, specifying a server to which request is sent. This is a required parameter of post method.
data: post data to send to the server along with HTTP request. For example, data to be used to query user id/password from the database server. For which, the script may be written in the specified URL. This is an optional parameter of post method.
callback function: Optional parameter. If a request is successful in post method, this function will execute if given. It also contains returned data from the server. The other parameters in this call function are:
Callbackfunction(data, status, xhr)
Where,
Data = returned data from the server.
Status = returns request status i.e. success, error, timeout, notmodified.
xhr= it contains XMLHttpRequest object. In case of Internet Explorer, it defaults to ActiveXObject. Otherwise XMLHttpRequest.
dataType: It specifies the type of returned data from the server to a callback function. The returned data in post function may be in these forms:  text, HTML, script, XML, JSON, JSONP.

Need Help? Contact Us.

Log in

*
*

Forgot password?

*

New User

*
*
*
*