请问下,为什么像下面那样写json文件不能正确读取
{
"code": 0,
"data": [
{
"xxxx": "ccccccccc"
}
],
"message": ""
}
只能像下面那样写吗?
[
{
"xxxx": "ccccccccc"
}
]
写完你的json文件可以百度一下。找下json格式校验。把你的复制进去。然后对比网上搜到的json文件慢慢调试
就是这种
[
{
"goodName":"联想(Lenovo)拯救者Y70000P",
"img":"img/bjb/bjb1.jpg"
},
{
"goodName":"联想(Lenovo)拯救者Y70001P",
"img":"img/bjb/bjb2.jpg"
},
{
"goodName":"联想(Lenovo)拯救者Y70002P",
"img":"img/bjb/bjb3.jpg"
},
{
"goodName":"联想(Lenovo)拯救者Y70003P",
"img":"img/bjb/bjb4.jpg"
},
{
"goodName":"联想(Lenovo)拯救者Y70004P",
"img":"img/bjb/bjb5.jpg"
},
{
"goodName":"联想(Lenovo)拯救者Y70005P",
"img":"img/bjb/bjb6.jpg"
},
{
"goodName":"联想(Lenovo)拯救者Y70006P",
"img":"img/bjb/bjb7.jpg"
},
{
"goodName":"联想(Lenovo)拯救者Y70007P",
"img":"img/bjb/bjb8.jpg"
},
{
"goodName":"联想(Lenovo)拯救者Y70008P",
"img":"img/bjb/bjb9.jpg"
},
]