这是我得到的响应数据。有人可以知道如何解析这些数据吗?
"message":{
"amount":{"notFloat":"'asd' does not appear to be a float"},
"lastname":{"notEmpty"}:"lastname must be required"},
etc....
}
我想要的是以组织格式显示所有检测到的错误。
options.save(d, {
success: function (model, response) {
if(response['status'] == 'success'){
alert = new AlertView({type: 'success', message: 'New record successfully added.'});
} else {
alert = new AlertView({type: 'error', message: response['message']});
}
alert.render();
},
error: function (model, response) {
alert = new AlertView({type: 'error', message: response});
alert.render();
}
});