我想在之前将json-ld添加到我的网站,我想将它添加到我的开发站点进行测试
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"url": "xxxxxxxxxxxxxxxx",
"contactPoint": [{
"@type": "ContactPoint",
"telephone": "+xx-xxx-xxx-xxxx",
"contactType": "customer service"
}]
}
</script>
Run Code Online (Sandbox Code Playgroud)
我收到错误,指出Missing'}'或对象成员名称.什么是这个错误,我已正确关闭括号.如何修复它,请帮助
P-S*_*P-S 27
通常此错误是由于不需要的逗号,请确保从每个{}块中的所有最后元素中删除尾随逗号.
示例代码段:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Article",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "http://foo.bar", // Remove comma here
}, // Remove comma here
// Add other required fields if necessary
}
</script>
Run Code Online (Sandbox Code Playgroud)
小智 5
我遇到了完全相同的问题。JSON-LD 标记与最后一个元素后面的逗号等无关。您的绝对正确。
但请注意,''Google 不接受单引号或单引号。您必须对""每个键和值使用双引号或,包括数组中的元素而不是数组本身。
| 归档时间: |
|
| 查看次数: |
12755 次 |
| 最近记录: |