jquery.post usage http://www.jb51.net/article/45181.htm
When using ajax to obtain data data, you can get it directly from data.foo. However, lower versions of jquery will not work. For example, before 1.4
$ .post('/admin/UserBookView.do', {}, function(data) {
console.info(data);
});
Print data information and display is a string in json format, as follows:
{" acceptIs":null,"entity":null,"refuseIs":null,"result":{"pageSize":10,
"resultList":[{"PRICE":3,"WCTIME":null," NOTE":"Points exception","CKTIME":null,"CUSER":"admin",
"CTIME":"2013/12/30 17:03:16","PHONE":"13111050937", "ADDR":"Test Address","CUSERID":"1","SLTIME":null}],
"resultListArray":null,"titles":["ID","CTIME","STATE" "PRICE","NOTE"],"totalPage":1,"totalSize":4},
"source":null,"storageIs":null,"treeNodes":null}
If type is not set, the data returned by default is text type
When we use data. to try to get the value inside, undefined is returned
There are two solutions at this time :
1: Use the eval function to convert the json string into a json object
var datas=eval("(" data ")");
Reference:
The relationship between javascript eval and JSON Two: Specify type
$.post( '/admin/UserBookView.do', {}, function(data) {
console.info(data);
},"json");
Higher versions such as 1.8 Then there is no such problem, and the returned object is json object