Note: $.get() and $.post() methods are global functions in jQuery. The load() method mentioned earlier operates on jQuery objects.
1. $.get() method
The $.get() method uses the GET method to make asynchronous requests.
Its grammatical structure is:
$.get( url [, data] [, callback] [, type] )
The $.get() method parameters are explained in the following table:
|
Type | Description | |||||||||||||||
url | String | URL address of the requested HTML page | |||||||||||||||
data (optional) | Object | The key/value data sent to the server will be appended to the request URL as QueryString | |||||||||||||||
callback (optional) | Function | The callback function when loading is successful (success will only call this method when the Response returns the status) automatically passes the request result and status to this method TD> | |||||||||||||||
type (optional) | String | The format of the content returned by the server, including xml, html, script, json, text and _default |