One, theload method asynchronously requests data
Use the load () method to load the data from the server via an AJAX request and place the returned data into the specified element, which is called in the following format:
Load (Url,[data],[callback])
The parameter URL is the load server address, and optionally the data parameter is the callback function that is sent when the data request is requested, and the callback parameter is the execution of the database.
Two, asynchronously loading JSON- formatted data using the Getjson () method
Using the Getjson () method, you can obtain an array from the server by means of an AJAX asynchronous request, and parse the obtained data into the page, which is called in the following format:
Jquery.getjson (Url,[data],[callback]) or $.getjson (Url,[data],[callback])
Where the URL parameter is the server address for the request to load the JSON-formatted file, the option data parameter is the one that is sent when the request is requested, and the callback parameter is the callback function that executes after the data request succeeds.
third, asynchronously loads and executes the JS file using the getScript () method
Use the Getscript () method to asynchronously request and execute a JavaScript-formatted file in the server with the following invocation format:
Jquery.getscript (Url,[callback]) or $.getscript (Url,[callback])
The parameter URL is the server request address, and the optional callback parameter is the callback function that executes after the request succeeds.
Four, use the Get () method to Get the data from the server in Get mode
When using the Get () method, a Get method is used to request data to the server, and the requested data is returned through the parameters of the callback function in the method, and its invocation format is as follows:
$.get (Url,[callback])
The parameter URL is the server request address, and the optional callback parameter is the callback function that executes after the request succeeds.
Five, use the post () method to send data from the server in post
Compared to the Get () method, the post () method is used to send data to the server in post, the server receives the data, processes it, and returns the processing result to the page, called the following format:
$.post (Url,[data],[callback])
The parameter URL is the server request address, optionally the data to be sent to the server when requested, the optional callback parameter is the callback function executed after the request succeeds.
jquery Ajax Call (a)--load pass data