after the alert(JSON.stringify(ort_list));
I'm getting output like this.
[{"status":"success","result":{"BUNDESLAND_NAME":"Rheinland-Pfalz","KREIS_TYP":"Landkreis","GEMEINDE_NAME":"Aach","GEMEINDE_LAT":"4978960","GEMEINDE_LON":"659052","ID_0":"2","ORT_NAME":"Aach","ORT_LAT":"4978972","ORT_LON":"659055","PLZ":"54298"}}]
now I want to get the alert value of BUNDESLAND_NAME
how could I get that.
Use this:
var data = [{"status":"success","result":{"BUNDESLAND_NAME":"Rheinland-Pfalz","KREIS_TYP":"Landkreis","GEMEINDE_NAME":"Aach","GEMEINDE_LAT":"4978960","GEMEINDE_LON":"659052","ID_0":"2","ORT_NAME":"Aach","ORT_LAT":"4978972","ORT_LON":"659055","PLZ":"54298"}}];
alert(data[0].result.BUNDESLAND_NAME);
or directly, based on your code
alert(ort_list[0].result.BUNDESLAND_NAME);
assume
ort_list = [{"status":"success","result":{"BUNDESLAND_NAME":"Rheinland-Pfalz","KREIS_TYP":"Landkreis","GEMEINDE_NAME":"Aach","GEMEINDE_LAT":"4978960","GEMEINDE_LON":"659052","ID_0":"2","ORT_NAME":"Aach","ORT_LAT":"4978972","ORT_LON":"659055","PLZ":"54298"}}];
<?php
$data='[{"status":"success","result":{"BUNDESLAND_NAME":"Rheinland-Pfalz","KREIS_TYP":"Landkreis","GEMEINDE_NAME":"Aach","GEMEINDE_LAT":"4978960","GEMEINDE_LON":"659052","ID_0":"2","ORT_NAME":"Aach","ORT_LAT":"4978972","ORT_LON":"659055","PLZ":"54298"}}]';
$newData=json_decode($data,true);
echo '<pre>';
print_r($newData);
echo '</br>';
echo 'the field you are looking for is : '.$newData[0]['result']['BUNDESLAND_NAME'];
And the output is :
Array
(
[0] => Array
(
[status] => success
[result] => Array
(
[BUNDESLAND_NAME] => Rheinland-Pfalz
[KREIS_TYP] => Landkreis
[GEMEINDE_NAME] => Aach
[GEMEINDE_LAT] => 4978960
[GEMEINDE_LON] => 659052
[ID_0] => 2
[ORT_NAME] => Aach
[ORT_LAT] => 4978972
[ORT_LON] => 659055
[PLZ] => 54298
)
)
)
the field you are looking for is : Rheinland-Pfalz
So here i provide you how your array looks like and how i access the specific element you wanted. I hope it's clear.