Parameters Description: .
url: request url from which you want to retrieve the data . data: data to be sent to the server with the request as a query string .
callback: function to be executed when request succeeds .
The following example shows how to retrieve data from a text file.
In the above example, first parameter is a url from which we want to retrieve the data.
Here, we want to retrieve data from a txt file located at mydomain.com/data.txt. Please note that you don't need to give base address.
Internally, jQuery get() method calls ajax() method only. Visit james.padolsey.com/jquery and search for get() method to see the source code.
Data contains response data, textStatus contains status of request and jqXHR is a jQuery XMLHttpRequest object which you can use for further process.
The following example shows how to retrieve JSON data using get() method.
We have specified name parameter with value 'Steve' in the JSON format. So now, the request url would look like http://mydomain.com/jquery/getjsondata?name=Steve .