Ran*_*952 1 javascript arrays jquery json
我想显示一个JSON数组的数据,我试过这个但它不起作用:
var Content = [{
"01":[{"text":"blablablablabla","foo":"abeille :o"}],
"02":[{"text":"blobloblobloblo","fuuu":"bzzzz :)"}],
"03":[{"text":"blibliblibli","fiii":"bzzoooo ;)"}]
}];
alert(Content.01.foo);
Run Code Online (Sandbox Code Playgroud)
这该怎么做?
你需要引号和数组索引.
// v---index 0 of the Array
Content[0]["01"][0].foo
// ^---index 0 of the Array
// ^----^---square brackets and quotes
Run Code Online (Sandbox Code Playgroud)