我有2個陣列看起來像這樣:如何動態導航javascript多維數組數組?
vars arrayVars = ["s", "p", "o"]
arrayBindings = [ {
"s": { "type": "uri" , "value": "http://ss.ldm.io/" } ,
"p": { "type": "uri" , "value": "http://xmlns.com/foaf/0.1/name" } ,
"o": { "type": "literal" , "value": "ss" }
} ,
{
"s": { "type": "uri" , "value": "http://ss.ldm.io/" } ,
"p": { "type": "uri" , "value": "http://xmlns.com/foaf/0.1/img" } ,
"o": { "type": "uri" , "value": "http://fbcdn-sphotos-d-a.akamaihd.net/o.jpg" }
},
...
]
我想基礎上,第一個參數,基本上就能夠導航arrayBindings
動態:
arrayBindings[0].s.value
讓我"http://ss.ldm.io/"
但這樣做它就像arrayBindings[0].arrayVars[0].value
那樣沒有用。
賓果!它的作品非常感謝。 – mzereba 2014-10-01 07:41:19
不客氣。 – 2014-10-01 07:41:44