Understanding How to Retrieve Specific Values in json Format Data

Asked 2 years ago, Updated 2 years ago, 84 views

Using the e-stat API of the Statistics Bureau of the Ministry of Internal Affairs and Communications, we obtained data on the total population of Japan in json.

I want to store only the value I want in the variable in the json data, but I don't know how to do it no matter how much I look into it.

I don't know if I can do that in the first place, but I would appreciate it if you could give me some advice.

My language is javascript.

javascript json

2022-09-30 17:18

2 Answers

Retrieved in json.

Does json mean the json string?
Why don't you parse it and get it from Object?
As a result of parsing, I don't know if it's a multidimensional array or not...

//json string
varjson_data='{"suffix1":"value1", "suffix2":"value2", "suffix3":"value3"}';
// Perth JSON
vardata = JSON.parse(json_data);
alert(data["suffix1"]);


2022-09-30 17:18

Hello,

Is it like displaying JSON data?
I once wrote a sample article on Qiita to obtain it using jQuery, so I will attach a link.For your information.

http://qiita.com/miiitaka/items/f77cb83b9dfcd05aea82


2022-09-30 17:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.