jquery ajax fetch data after processing summary (Html,xml,json) _jquery

Source: Internet
Author: User
1, HTML processing is relatively simple, direct output can be.
General use $ ("Jb51div"). innerHTML, etc.

2, JSON format data call
Copy Code code as follows:

$.ajax ({
URL: "/trundle/rawcontentaction.getajaxcontent.act",
Data: "Param1=22",
DataType: "JSON",//The dataType here is the data format returned back Html,xml,json
cache:false,//settings are cached, the default setting is True, and you need to set to false when you need to perform database operations on each refresh
Success:function (data) {
$ (data). each (function (TE, u) {
Alert (TE);
$ ("#content"). Append (u.title+ "</br>");
})
}
})

3, XML format data call
Copy Code code as follows:

$.ajax ({
URL: "/trundle/rawcontentaction.getajaxcontent.act",
Dat A: "param1=22",
DataType: "xml",//The DataType here is the returned data format Html,xml,json
cache:false,//settings are cached, the default setting is true, when you need You need to set to False
Success:function (XML) {
$ (XML) If you need to perform database operations on each refresh. Find ("*"). each (function () {
///This is where the traversed content is , jquery is a
} that can be traversed using XPath
}
})
Related Article

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.