{
"address": [{
"addressLine1": "Noida",
"addressLine2": "UP"
}],
}
{
"address": [{
"addressLine1": "Noida",
"addressLine2": "UP"
}],
}
{
"address": [{
"addressLine1": "Noida",
"addressLine2": "UP"
}],
}
我在json文件中有几个不同的json对象。
我有一个java代码来阅读每个地址地址线1.
我想知道有没有办法跳过第二个地址并转到第三个地址阅读地址线?
答案 0 :(得分:0)
如果你有固定地址列表,你可以像地址[0] .addressLine1,地址[0] .addressLine2和地址[2] .addressLine1,地址[2] .addressLine2
那样做答案 1 :(得分:0)
如果你有固定的结构地址列表,你可以得到这样的值:
alert ( objectJSON.address[0].addressLine1);
alert ( objectJSON.address[0].addressLine2);
alert ( objectJSON.address[2].addressLine1);
alert ( objectJSON.address[2].addressLine2);
请尝试