开发者

How to check this Json response whether its null or not

{"PatientPastMedicalHistoryGetResult":{"PastMedicalHistory":[]}}

The PastMedicalHistory array is NU开发者_如何转开发ll without values. How can i check it.


if (response.PatientPastMedicalHistoryGetResult.PastMedicalHistory.length == 0) {

}

And this isn't null. This is an empty array.


If you have null in response, Try

   var data = {"PatientPastMedicalHistoryGetResult":{"PastMedicalHistory":[]}};

    for (member in data) {
        if (data[member] != null)
            // Do work here
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜