2016-06-27 171 views
3

は、私はその行方不明「}」またはオブジェクトメンバ名を示すエラーを取得しJSON-LD '}'またはオブジェクトメンバー名がありません。私はその前に私のウェブサイトに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> 

それをテストするために私のdevのサイトに追加します。このエラーは何ですか、私はそれを親切に助けるために括弧を正しく閉じました

+0

をそれが有効なJSONかもしれないが、それは有効なJavaScriptではありません。 –

+0

このエラーはどこにありますか? – unor

答えて

6

通常、このエラーはの不要なカンマのため、すべての{}ブロックのすべての最後の要素から末尾のカンマを削除してください。

例は、スニペット:

<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> 
+1

これは正解です。 –

関連する問題