Load the content of the file "demo_test.txt" into a specific <div> element:
The load() method loads data from a server and puts the returned data into the selected element.
Note: There is also a jQuery Event method called load. Which one is called, depends on the parameters.
|url||Required. Specifies the URL you wish to load|
|data||Optional. Specifies data to send to the server along with the request|
|function(response,status,xhr)||Optional. Specifies a callback function to run when the load() method is completed.
Make an AJAX request, and send data with the request
How to use the data parameter to send data with the AJAX request (this example uses the an example explained in our AJAX Tutorial)
Make an AJAX request and use a callback function
How to use the function parameter to work with the data result from the AJAX request.
Make an AJAX request with an error
How to use the function parameter to deal with errors in an AJAX request (using the XMLHttpRequest parameter).