JSONObject in JSONObject

前端 未结 3 1733
青春惊慌失措
青春惊慌失措 2021-01-04 08:27

I have an API Output like this:

{\"user\" : {\"status\" : {\"stat1\" : \"54\", \"stats2\" : \"87\"}}}

I create a simple JSONObject

3条回答
  •  一个人的身影
    2021-01-04 09:19

    To access properties in an JSON you can parse the object using JSON.parse and then acceess the required property like:

    var star1 = user.stat1;
    

提交回复
热议问题