1. html processing is relatively simple and can be output directly.
Generally, you can use $ ("jb51div"). innerHTML, etc.
2. json format data calling
Copy codeThe 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 codeThe 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, // 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 (xml ){
$ (Xml). find ("*"). each (function (){
// Process the retrieved content. jquery can use xpath for traversal.
})
}
})