JQueryAjax $. get () method and $. post () method _ jquery

Source: Internet
Author: User
The load () method is usually used to obtain static data files from the Web server. However, this does not reflect the full value of Ajax. In the project, if you need to pass some parameters to the page on the server, you can use $. get () or $. the post () method (or the $. ajax method ). Note:The $. get () and $. post () methods are global functions in jQuery. The load () method mentioned above is used to operate jQuery objects.

1. $. get () method

The $. get () method uses the GET Method for asynchronous requests.

Its syntax structure is:

  $. Get (url [, data] [, callback] [, type])

$. Get () method parameters are described as follows:

Parameter Name Type Description
Url String URL 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 calls this method only when Response returns the status) automatically passes the request result and status to this method.
Type (optional) String The format of the content returned by the server, including xml, html, script, json, text, and _ default.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.