When using AJAX to get data, direct Data.foo can be obtained. and the lower version of jquery is not a good example before 1.4, here is a brief introduction to the Jquery.post usage about the type Setup problem
When using AJAX to get data, direct Data.foo can be obtained. and the lower version of jquery doesn't work. For example, before 1.4 code as follows: $.post ('/admin/userbookview.do ', {}, function (data) { Console.info ( Data); }); Print the data information, displaying a JSON-formatted string with the following: code: {"Acceptis": null, "entity": null, "Refuseis": NULL, ' result ': {' pageSize ':10, ' resultlist ': [{' Price ': 3, ' wctime ': null, ' note ': ' Integral 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 no type is set, the default returned data is the text type when we use data. To try to get the value inside, the return is undefined Two solutions: One: Use the Eval function to convert the JSON string to a JSON object copy code code as follows: Var datas= Eval ("(" +data+) "); Reference: Relationship between JavaScript eval and JSON Two: Specify type Copy code code as follows: $.post ('/admin/ Userbookview.do ', {}, function (data) { CoNsole.info (data); }, "JSON"); high version such as 1.8+ does not have this problem, returns the JSON object