调用Json中的数组
Calling the Arrays in Json
我们有类似的json数据
Orgnaizationunit [
{"name":london , "Coordinates":[39.78,22.30]} ,
{"name" : Newyork, "Coordinates":[39.81,22.37}
]
在JavaScript中,我们可以将数组中的第一个元素称为
Organizationunit[0].name
我想知道如何调用坐标。我称之为
Organizationunit[0].Coordinates[0][1]
但是我得到了未定义的错误
像这个
var Orgnaizationunit = [
{"name": 'london', "Coordinates":[39.78,22.30]},
{"name": 'Newyork', "Coordinates":[39.81,22.37]}
];
console.log(Orgnaizationunit[0].Coordinates[0]);
console.log(Orgnaizationunit[0].Coordinates[1]);
相关文章:
- 为DataTables aoColumnDefs创建JavaScript数组(JSON格式)
- 使用 Javascript 将行添加到数组 json
- PHP数组JSON编码和该对象在ExtJs中解码
- 数组json转换为数组json
- 将Blob文本转换为Javascript中的数组/JSON对象
- 如何合并这些数组/json 对象
- 尝试从数组 JSON 键中删除引号
- JavaScript 中的数组 JSON
- 在数组 JSON 格式的 JavaScript 变量末尾添加新地址
- 如何访问这个Javascript数组(JSON对象?)
- rails传递记录数组(JSON)
- 按值提取对象/数组json vs数组
- 获取具有子数组json值的数组的值
- Object对象数组Json.字符串数组的字符串化
- 如何在Ext js 4.1中过滤数组json
- PHP -多维数组Json
- 正在分析数组Json以选择Tag
- 试图将字符串数据转换为数值数据,将数据放入数组的数组(Json)
- 从数组json、javascript中的specf值中删除引号
- 使用JavaScript或jQuery读取数组JSON