本文介绍了如何从arrayobject获取数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我正在使用javascript,这里我面临着将arrayobject提取到应用程序本地变量的问题。 这里是jsonarray。 { 结果:[ { address_components:[ { long_name:15-5-849, short_name:15-5-849, 类型:[前提] }, { long_name:500012, short_name:500012, 类型:[postal_code] } ], formatted_address:15-5-849,National Highway 7,Mahaboob Gunj,Afzal Gunj,Hyderabad,Telangana 500012,印度, 几何:{ 位置:{ lat:17.3735682, lng:78.4767143 }} } ] } 这里我想把formated_address值变成局部变量。 感谢建议的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推荐答案 如果我假设你的json对象被命名为数据,那么检索地址的代码将是data.results [0] .formatted_address; If I assume that you json object is named as data then the code to retrieve address will be data.results[0].formatted_address; 这篇关于如何从arrayobject获取数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-13 16:42