Parse json i javascript
Denne json string bliver hentet via DMI frie data, hvordan for jeg trukketdata ud via javascript , så det bliver vist på en html side ca. sådan her:
observed : Time:Minut
temp_dew : value (grader)
Jeg har forsøgt med JSON.parse() og myObj.filter(e => og
document.getElementById("test").innerHTML =myObj
men intet lykkes
Jeg modtager denne via DMI's API
{"type":"FeatureCollection","features":[{"geometry":{"coordinates":[11.6035,55.7358],"type":"Point"},"id":"0f00f0a1-041f-2551-fc1c-d47683b80fb5","type":"Feature","properties":{"created":"2021-10-30T11:09:00.959722Z","observed":"2021-10-30T11:10:00Z","parameterId":"visibility","stationId":"06156","value":18000.0}},{"geometry":{"coordinates":[11.6035,55.7358],"type":"Point"},"id":"148a16a8-d3c6-2a83-6054-73d93d74ebef","type":"Feature","properties":{"created":"2021-10-30T11:09:00.860669Z","observed":"2021-10-30T11:10:00Z","parameterId":"radia_glob","stationId":"06156","value":124.0}},{"geometry":{"coordinates":[11.6035,55.7358],"type":"Point"},"id":"38f43e5d-e1ed-b2a2-6efc-47de14e0191c","type":"Feature","properties":{"created":"2021-10-30T11:09:00.864401Z","observed":"2021-10-30T11:10:00Z","parameterId":"temp_dew","stationId":"06156","value":10.2}},{"geometry":{"coordinates":[11.6035,55.7358],"type":"Point"},"id":"3d946786-a5cc-0122-dc76-34f129b6a20d","type":"Feature","properties":{"created":"2021-10-30T11:09:00.861721Z","observed":"2021-10-30T11:10:00Z","parameterId":"sun_last10min_glob","stationId":"06156","value":0.0}},{"geometry":{"coordinates":[11.6035,55.7358],"type":"Point"},"id":"42c98934-15c7-2cd6-effa-91229631a365","type":"Feature","properties":{"created":"2021-10-30T11:09:00.865493Z","observed":"2021-10-30T11:10:00Z","parameterId":"temp_dry","stationId":"06156","value":12.0}},{"geometry":{"coordinates":[11.6035,55.7358],"type":"Point"},"id":"4bce3f9f-ff95-9812-2fd9-69c4b02ac479","type":"Feature","properties":{"created":"2021-10-30T11:09:00.875540Z","observed":"2021-10-30T11:10:00Z","parameterId":"pressure","stationId":"06156","value":1006.1}},{"geometry":{"coordinates":[11.6035,55.7358],"type":"Point"},"id":"6bb0ae4d-5281-b956-98b3-2c0661e494c4","type":"Feature","properties":{"created":"2021-10-30T11:09:00.958168Z","observed":"2021-10-30T11:10:00Z","parameterId":"visib_mean_last10min","stationId":"06156","value":18400.0}},{"geometry":{"coordinates":[11.6035,55.7358],"type":"Point"},"id":"7c36119f-a25f-1f28-76e1-b57fd9bc8c57","type":"Feature","properties":{"created":"2021-10-30T11:09:00.956833Z","observed":"2021-10-30T11:10:00Z","parameterId":"leav_hum_dur_past10min","stationId":"06156","value":0.0}},{"geometry":{"coordinates":[11.6035,55.7358],"type":"Point"},"id":"842f85f3-f9d6-3fe5-07e7-198512575c10","type":"Feature","properties":{"created":"2021-10-30T11:09:00.958651Z","observed":"2021-10-30T11:10:00Z","parameterId":"cloud_cover","stationId":"06156","value":10.0}},{"geometry":{"coordinates":[11.6035,55.7358],"type":"Point"},"id":"91924035-f8e5-4c93-8634-f900c16b6632","type":"Feature","properties":{"created":"2021-10-30T11:09:00.875906Z","observed":"2021-10-30T11:10:00Z","parameterId":"pressure_at_sea","stationId":"06156","value":1007.7}}],"timeStamp":"2021-10-30T11:19:19Z","numberReturned":10,"links":[{"href":"https://dmigw.govcloud.dk/v2/metObs/collections/observation/items?period=latest-day&stationId=06156&limit=10&api-key=92c9f900-e66b-4bf8-9b11-50ae10b8baf7","rel":"self","type":"application/geo+json","title":"This document"},{"href":"https://dmigw.govcloud.dk/v2/metObs/collections/observation/items?period=latest-day&stationId=06156&limit=10&api-key=92c9f900-e66b-4bf8-9b11-50ae10b8baf7&offset=10","rel":"next","type":"application/geo+json","title":"Next set of results"}]}
På forhånd tak :)