Home > front end >  $. Ajax accept @ ResponseBody returned List <bean> JSON string display Object
$. Ajax accept @ ResponseBody returned List <bean> JSON string display Object

Time:10-03

The Controller with the @ ResponseBody annotation return List The JSON string, the front desk with JQUERY $. AJAX to accept, but the reality is


The front desk


The background

CodePudding user response:

Because you have a dataTYpe: "json"
So the returned json string by decoding the became a js object array
You need a visit by the agreement of the property name

CodePudding user response:

Data [0]. The property name (such as: uname/uid oneself life entity class attribute name),

CodePudding user response:

Crap, alert cannot pop-up object, use the console log

CodePudding user response:

The console output. The log (data) or alert (data [0]. XXX)
  • Related