The commonly used ajax methods provided by jquery are: 1. "$.ajax()" method, used to perform asynchronous HTTP (Ajax) requests; 2. "$.get()" method; 3. "$ .post()" method; 4. "$.getJSON()" method; 5. "serialize()" method, etc.
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
Native AJAX requests are sent in native JavaScript, which is very cumbersome. Using jQuery will be simpler and faster.
$.ajax method
url represents the requested address type represents the type of request GET or POST request data represents the data format sent to the server There are two types: One: name=value&name=value Two: {key:value} success The request is successful, the response callback function dataType The response data type. Commonly used data types are: text Represents plain text xml Represents xml data json Represents json object$.get method and $.post method
url requested url address data sent data callback successful callback function type returned data type because get or post has specified the request Type, so there is no need to pass in the type parameter$.getJSON method
Form serialization serialize()
jQuery Tutorial(Video)
The above is the detailed content of What are the commonly used ajax methods provided by jquery?. For more information, please follow other related articles on the PHP Chinese website!