Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using javascript , here i am facing problem to fetch arrayobject to application local varible.
here is the jsonarray.

{
"results" : [
{
"address_components" : [
{
"long_name" : "15-5-849",
"short_name" : "15-5-849",
"types" : [ "premise" ]
},
{
"long_name" : "500012",
"short_name" : "500012",
"types" : [ "postal_code" ]
}
],
"formatted_address" : "15-5-849, National Highway 7, Mahaboob Gunj, Afzal Gunj, Hyderabad, Telangana 500012, India",
"geometry" : {
"location" : {
"lat" : 17.3735682,
"lng" : 78.4767143
}}
}
]
}

here i want to get formated_address value into local variable.

Thanks for suggestion's
Posted
Updated 16-Jul-14 1:47am
v3

1 solution

If I assume that you json object is named as data then the code to retrieve address will be data.results[0].formatted_address;
 
Share this answer
 
Comments
Unareshraju 16-Jul-14 8:13am    
Hi Arun, thanks for responding, yeah i am also did the same way, but it does n't showing any thing console as well as alert, actually we closely for solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900