【问题标题】:Error "Missing '}' or object member name" in Google SDTTGoogle SDTT 中出现错误“缺少 '}' 或对象成员名称”
【发布时间】:2017-01-25 07:23:38
【问题描述】:

我有以下 JSON LD 数据:

<script type="application/ld+json">
{
  "@context": "http://schema.org", 
  "@type": "NewsArticle", 
  "mainEntityOfPage": {
      "@type": "WebPage",
      "@id": "http://healthypets.mercola.com/sites/healthypets/archive/2017/01/25/dog-foods-contain-high-fluoride-levels.aspx"
  },
  "headline": "80 Percent of Tested Dog Foods Contain High Fluoride Levels", 
  "datePublished": "2017-01-25T12:00:00Z", 
  "dateModified": "1/18/2017 7:28:27 PM", 
  "description": "A study found that 8 out of 10 dog food brands contained fluoride 2.5 times higher than the EPA national drinking water standard.", 
  "author": { 
      "@type": "Person", 
      "name": "Dr. Becker", 
  },
  "publisher": { 
      "@type": "Organization", 
      "name": "Mercola.com", 
      "logo": { 
          "@type": "ImageObject", 
          "url": "http://media.mercola.com/themes/healthypets/images/healthypets-logo-responsive.png", 
          "width": 600, 
          "height": 60 
      }
  }, 
  "image": { 
      "@type": "ImageObject", 
      "url": "http://media.mercola.com/themes/healthypets/images/healthypets-logo-responsive.png", 
      "width": 2000,
      "height": 800 
  }
}
</script>

请看下面的错误:

我收到错误说明

缺少“}”或对象成员名称。

【问题讨论】:

  • 不确定它是否接受author 对象末尾的,(后跟})。你检查过 JSON 解析器中的格式吗?

标签: json json-ld


【解决方案1】:

author对象的最后一个键中删除,

"author": { 
  "@type": "Person", 
  "name": "Dr. Becker", 
},

应该是

"author": { 
  "@type": "Person", 
  "name": "Dr. Becker"
},

您可以在 http://json-ld.org/playground/ 上测试您的 JSON-LD

【讨论】:

    【解决方案2】:

    author对象属性"name": "Dr. Becker",中的第14行删除逗号

    只喜欢"name": "Dr. Becker"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-03-19
      • 2016-12-15
      • 2020-03-11
      • 1970-01-01
      • 2021-08-14
      • 1970-01-01
      • 2021-03-31
      相关资源
      最近更新 更多