我有一个JSON:
{" a" :" 123", " B" :" rrdf", " C" :{ "法国" :" frnch", "德国" :" gmn", "西班牙语" :" spns", "意大利" :" itln" } }
我想提取c的值(这是非常复杂的),因为这个:::
{french=frnch,
german=gmn",
spanish=spns",
italian=itln"}
答案 0 :(得分:1)
您可以将JSON分配给对象并使用objectName.propertyName
,例如obj.c
var obj = {
"a": "123",
"b": "rrdf",
"c": {
"french": "frnch",
"german": "gmn",
"spanish": "spns",
"italian": "itln"
}
}
console.log(obj.c);
答案 1 :(得分:0)
试试这个
var a = {
"a": "123",
"b": "rrdf",
"c": {
"french": "frnch",
"german": "gmn",
"spanish": "spns",
"italian": "itln"
}
}
console.log(a.c)