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

Following is the syntax of jQuery ajax get method:
$.get( url, [data], [callback function], [type] )
Where,
URL is a string specifying server to which request is sent. This is the required parameter of get jQuery.
data: Here, you will specify the data to send to the server along with HTTP request. This is an optional parameter.
callback function: Optional parameter. If the request is successful, this function will execute. It also contains the returned data from the server. The other parameters in this jQuery get callback 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.
Type: It specifies the type of returned data from the server to the callback function. The returned data may be in these forms:  text, HTML, script, XML, JSON, jsonp.

Need Help? Contact Us.

Log in

*
*

Forgot password?

*

New User

*
*
*
*