试图弄清楚为什么我无法解析我的 JSON 文件

Trying to figure out why i cannot parse my JSON file

我无法找出我在这个 JSON 文件中的错误所在。我知道某处有一个,因为在尝试解析它时。我收到错误 Uncaught SyntaxError: Unexpected token J 我想知道你们是否可以帮我看一下,看看你们是否看到我的问题,我整晚都在研究这个问题,但我仍然无法找到错误。社区的某个人帮我找到了一个,但它仍然无法正常工作我正在解析 JSON 像这样

var obj = JSON.parse("JSON.json");

这里是 JSON

{
"Subbackground":{"direction": "to bottom", "Color1": " #a90329 0%", "Color2": "#8f0222 44%", "Color3": "#6d0019 100%"},
"ButtonBG": {"direction":"to bottom", "Color1": "#216332 5%", "Color2": "#5cbf2a 100%"},
"ButtonHov": {"direction":"to bottom", "Color1": "#5cbf2a 5%", "Color2": "#216332 100%"},
"textColor":"#ffffff",
"BorderSubColor":"#a90329",
"ButtonShadow":"#2f6627",
"ButtonBShawdow":"#3dc21b",
"BorderMain":"#18ab29",
"Sub1":"steaknshake", "urlPath1":"http://www.steaknshake.com/",
"Sub2":"steaknshake", "urlPath2":"http://www.steaknshake.com/",
"Sub3":"steaknshake", "urlPath3":"http://www.steaknshake.com/",
"Sub4":"steaknshake", "urlPath4":"http://www.steaknshake.com/",
"Sub5":"steaknshake", "urlPath5":"http://www.steaknshake.com/",
"Sub6":"steaknshake", "urlPath6":"http://www.steaknshake.com/",
"Sub7":"steaknshake", "urlPath7":"http://www.steaknshake.com/",
"Sub8":"steaknshake", "urlPath8":"http://www.steaknshake.com/",
"Sub9":"steaknshake", "urlPath9":"http://www.steaknshake.com/",
"Sub10":"steaknshake", "urlPath10":"http://www.steaknshake.com/",
"Pizza":"steaknshake", "urlPathP":"http://www.steaknshake.com/",
"Berger":"steaknshake", "urlPathB":"http://www.steaknshake.com/",
"Lobster":"steaknshake", "urlPathL":"http://www.steaknshake.com/",
"Chicken":"steaknshake", "urlPathCN":"http://www.steaknshake.com/",
"Shrimp":"steaknshake", "urlPathSP":"http://www.steaknshake.com/",
"BLT":"steaknshake", "urlPathB":"http://www.steaknshake.com/",
"Salmon":"steaknshake", "urlPathSN":"http://www.steaknshake.com/",
"CatFish":"steaknshake", "urlPathCF":"http://www.steaknshake.com/",
"Steak":"steaknshake", "urlPathSK":"http://www.steaknshake.com/",
"Crab":"steaknshake", "urlPathCB":"http://www.steaknshake.com/"
}

在最后一行,您没有关闭 urlPath 值周围的引号:

"Crab":"steaknshake", "urlPath":"http://www.steaknshake.com/"
                                                            ^ was missing

为了将来参考,您可以使用 jsonlint.com 来测试有效 JSON 并查找错误。