Home > Web Front-end > JS Tutorial > body text

jQuery Ajax $.get() method and $.post() method_jquery

WBOY
Release: 2016-05-16 18:44:48
Original
1108 people have browsed it

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:

参数名称 类 型 说  明
url String 请求的HTML页的URL地址
data(可选) Object 发送至服务器的key/value数据会作为QueryString附加到请求URL中
callback(可选) Function 载入成功时的回调函数(只有当Response的返回状态时success才调用该方法)自动将请求结果和状态传递给该方法
type(可选) String 服务器端返回内容的格式,包括xml、html、script、json、text和_default
Parameter name
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
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template