这可能很容易,但我需要访问这个 JSON 对象中的值。我不知道怎么做。这是对象:
{
"COLUMNS": ["NAME"],
"DATA": [["YOUNG, MARIA "]]
}
我希望“obj.NAME”会这样做,但它说它是未定义的。这是我的 AJAX 调用:
$.ajax({
//this is the php file that processes the data and send mail
url: 'components/Person.cfc',
//GET method is used
type: "POST",
//pass the data
data: {
method: "getGroup",
uid: $('#cardText').val()
},
success: function(response) {
var obj = $.trim(response);
var obj = jQuery.parseJSON(obj);
$('#form_result').html(obj.NAME);
},