简体   繁体   English

如何从JSON获取某些数据

[英]How to get certain data from JSON

How do I classify the data in JSON returned by the API with javascript. 如何使用javascript对API返回的JSON中的数据进行分类。

The data given by the API: API提供的数据:

{  
   "referenceNumber":"55f97f3be4b0503165e858c5",
   "phoneNumber":"7877599999",
   "amount":15.00,
   "transStatus":"COMPLETED",
   "responseStatus":{  
      "status":"SUCCESS",
      "statusDescription":"The request is successful."
   }
}

I want to receive the number from phoneNumber with javascript. 我想通过javascript从phoneNumber接收号码。

var data = JSON.parse(apiResponse);

var phoneNumber = data.phoneNumber;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM