如何使用多个对象构造JSON文件

时间:2017-07-20 21:20:27

标签: json

到目前为止,我已将一个对象放入JSON文件中,以便在我的JavaScript代码中使用。像这样:

"disc":[
{"key":"0001","film":{"title":"12 Monkeys","director":"Terry Gilliam",...}},
...
}
]

现在我想在同一个文件中包含五个对象。我该如何构建文件?

1 个答案:

答案 0 :(得分:1)

[{"disc":[ {"key":"0001","film":{"title":"12 Monkeys","director":"Terry Gilliam"}} ]},{"disc":[ {"key":"0001","film":{"title":"12 Monkeys","director":"Terry Gilliam"}} ]},{"disc":[ {"key":"0001","film":{"title":"12 Monkeys","director":"Terry Gilliam"}} ]},{"disc":[ {"key":"0001","film":{"title":"12 Monkeys","director":"Terry Gilliam"}} ]},{"disc":[ {"key":"0001","film":{"title":"12 Monkeys","director":"Terry Gilliam"}} ]}]