html5 – 一个页面中的多个JSON-LD标签组

可以在同一页面中使用多个 JSON-LD组(使用Schema.org)吗?

如果我不能,怎么把它们结合在一起?我不太熟悉语法.

第1组:

<script type="application/ld+json">
{
  "@context": "http://schema.org","@type": "LocalBusiness","address": {
    "@type": "PostalAddress","streetAddress": "3102 Highway 98","addressRegion": "FL","addressLocality": "Mexico Beach","postalCode": "45252","addressCountry": "US",},"geo": {
    "@type": "GeoCoordinates","latitude": "40.75","longitude": "73.98"
  },"name": "Beachwalk Beachwear & Giftware","telephone": "850-648-4200","email": "admin@example.com","faxNumber": "860-562-4250",}
</script>

第2组:

<script type="application/ld+json">
{
    "@context": "http://schema.org","@type": "Organization","url": "http://example.com","name": "My Domain Title","logo": "http://example.com/wp-content/uploads/2015/08/abc.jpg","contactPoint": [
        {
            "@type": "ContactPoint","telephone": "0192-39192130","contactType": "customer service"
        },{
            "@type": "ContactPoint","telephone": "0182-239120398","contactType": "customer service"
        }
    ],"sameAs": [
        "http://facebook.com/myfbaccount","http://twitter.com/mytwitteraccount"
    ]
}
</script>

解决方法

您可以在页面上拥有多个脚本块,也可以将其组合到单个块中.将它们组合成单个块的最简单方法是使用@graph关键字,如下所示:
<script type="application/ld+json">
{
  "@graph": [
    { ... your first JSON-LD block ... },{ ... your second JSON-LD block ... }
  ]
}
</script>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


h5页面是什么意思
html5复合选择器都有哪些
什么是html5响应式布局
h5页面制作策划怎么做
html5关系选择器有哪些
h5有哪些缓存机制
position中的sticky如何使用
h5页面制作用什么软件
h5链接怎么做
html5层次选择器有哪些
h5是什么意思
localstorage有哪些方法
h5怎么制作点击图标
h5怎么制作倒计时
h5怎么生成链接
h5表格边框怎么设置
h5兼容问题怎么解决
h5怎么做交互设计
h5怎么做进度条
h5怎么加链接