【发布时间】:2014-06-04 13:12:22
【问题描述】:
当我在浏览器上运行这个 json 文件时,我发现了错误,我不知道为什么?
这是我的完整代码:
[
{
name: "Samsung Tab 3",
price: 500,
description:
"Samsung Tab 3 is very well "
+ "Samsung Tab 3 is very well ",
images: [
"images/tablet1.png",
"images/tablet1-thumb.png"
],
reviews: [
{
stars: 5,
body: "I Love this Tab",
author: "Michael.Gamel@hotmail.com"
},
{
stars: 1,
body: "this tab sucks",
author: "samir@hotmail.com"
}
],
processor: " Core™2 Duo",
ram: "1 GB",
colors: ["White","Red","Blue"],
canPurchase: true,
soldOut: false
}
,
{
name: "Apple iPad 4",
price: 500.50,
description:
"Apple iPad 4 is very well "
+ "Apple iPad 4 is very well ",
images: [
"images/tablet2.png",
"images/tablet2-thumb.png"
],
reviews: [
{
stars: 3,
body: "I Love this Tab",
author: "Michael.Gamel@hotmail.com"
},
{
stars: 4,
body: "this tab sucks",
author: "samir@hotmail.com"
}
],
processor: "core i3",
ram: "2 GB",
colors: ["Black", "Yellow", "Brown"],
canPurchase: true,
soldOut: false
}
]
我发现名称错误,我的浏览器告诉我:
错误:第 2 行的解析错误: [ { 名称:“三星标签 3 -----------------^ 期待“STRING”、“}”
这是什么意思??!!
【问题讨论】:
-
这是你可以自己调试的东西:jsonlint.com
-
这个问题似乎跑题了,因为 SO 不是调试服务。
标签: javascript asp.net json json.net getjson