I have a JSON string , I want to get value of JSON string property.I try
$.ajax({
type: "POST",
url: "../BUS/WebService.asmx/GET_TRANSACTION_NEW",
data: JSON.stringify(DTO),
contentType: "application/json; charset=utf-8",
dataType: 'json',
success: function (data) {
var obj = $.parseJSON(data.d);
alert(obj.DEPARTMENT_NAME);
},
error: function (data) {
alert("Error");
}
});
But it's not work , it's show alert
undefined
. This is console log data
Object {d: "[{"DEPARTMENT_ID":"D00000000001","DEPARTMENT_NAME"…"2015-05-05T00:00:00","EDIT_BY":"","FLAG":false}]"}
d: "[{"DEPARTMENT_ID":"D00000000001","DEPARTMENT_NAME":"HR","DEPARTMENT_DES":"HR","EDIT_DATE":"2015-05-05T00:00:00","EDIT_BY":"","FLAG":false},{"DEPARTMENT_ID":"D00000000002","DEPARTMENT_NAME":"ACCOUNT","DEPARTMENT_DES":"ACCOUNT","EDIT_DATE":"2015-05-05T00:00:00","EDIT_BY":"","FLAG":false}]"
__proto__: Object
Give me some advices, thank you