简体   繁体   English

在 JSON 代码上出现“解析错误” - 不知所措如何修复

[英]Getting "Parse Error" on JSON code - At a Loss How To Fix

Error Message From JSON Checker:来自 JSON Checker 的错误消息:

Parse error on line 1: < script type = "app ^ Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'第 1 行的解析错误:< script type = "app ^ Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'

My code on line 1:我在第 1 行的代码:

< script type = "application/ld+json" > { < 脚本类型 = "应用程序/ld+json" > {

I'm no coder or programmer, just trying to dress up my website with some JSON enhancements and can't seem to find out what's wrong with line 1. Can anybody help?我不是编码员或程序员,只是想用一些 JSON 增强功能来装饰我的网站,但似乎无法找出第 1 行有什么问题。有人可以帮忙吗?

I've looked all over the web for an answer and my code on line 1 appears to be correct.我已经在 web 中寻找答案,我在第 1 行的代码似乎是正确的。

I don't know what's wrong...我不知道怎么了...

Is JSON Checker an external JSON Validator? JSON Checker 是外部 JSON Validator 吗? To use it just try to validate what is inside of the script HTML element because that is the JSON. For example:要使用它,只需尝试验证脚本 HTML 元素中的内容,因为那是 JSON。例如:

<script type = "application/ld+json">
{"Hello":"World"}
</script>

In this case you have to validate:在这种情况下,您必须验证:

{ "Hello":"World" }

I hope this helps.我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM