我有一个 JSON 文件,用于存储我正在构建的某些报价生成器的报价。最近我在终端中遇到了这个错误(见下面的屏幕截图)。
Expected a JSON object, array or literal.json
这就是我的 JSON 的样子
data = [
{
"number": "1",
"author": "Von R. Glitschka",
"quote": "The client may be king, but he's not the art director."
},
{
"number": "2",
"author": "Frank Capra",
"quote": "A hunch is creativity trying to tell you something."
},
{
"number": "3",
"author": "Steven Heller",
"quote": "As a profession, graphic designers have been shamefully remiss or ineffective about plying their craft for social or political betterment." …Run Code Online (Sandbox Code Playgroud)