1. HTML processing is relatively simple and can be output directly.
Generally, you can use $ ("jb51div"). innerhtml, etc.
2. JSON format data calling
CopyCodeThe Code is as follows: $. Ajax ({
URL: "/trundle/rawcontentaction. getajaxcontent. Act ",
Data: "param1 = 22 ",
Datatype: "JSON", // The datatype here is the returned data format in HTML, XML, JSON
Cache: false, // set whether to cache. The default value is true. If you need to perform database operations for each refresh, set it to false.
Success: function (data ){
$ (Data). Each (function (Te, u ){
Alert (TE );
$ ("# Content"). append (U. Title + "</BR> ");
})
}
})
3. XML format data calling
copy Code the code is as follows: $. ajax ({
URL: "/trundle/rawcontentaction. getajaxcontent. act ",
data:" param1 = 22 ",
datatype:" XML ", // The datatype here is the returned data format in HTML, XML, JSON
cache: false, // sets whether to cache. The default value is true. To perform database operations every time you need to refresh, set the value to false.
success: function (XML) {
$ (XML ). find ("*"). each (function () {
// process the retrieved content. jquery can use XPath for traversal.
})
}< BR >})