I am dealing with a webservice that returns JSON data in the following format:
{"d":"{\"RES\":[],\"STAT\":\"FAIL\",\"SID\":\"0\"}"}
So, my question is how can I extract the STAT=FAIL value from this JSON response? The service is written in C#.
This is the script I have implemented:
$.ajax({
type: "POST",
url: "http://localhost/EMRDMSService/Service.asmx/User_Login",
data: "{lg:" + JSON.stringify(GetLogDet) + "}",
// url: "http://localhost/EMRDMSService/Service.asmx/Permission_List",
// data: "{userid:" + JSON.stringify(GetLogDet) + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
console.log(r.d.STAT);
}
});
However, when I try to access r.d.STAT, it returns undefined
.
Can anyone provide assistance on resolving this issue?