我正在尝试学习如何使这段代码有效。
<script>
document.write('<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Restaurant",
"address": {
"@type": "PostalAddress",
"addressLocality": "Sunnyvale",
"addressRegion": "CA",
"postalCode": "94086",
"streetAddress": "1901 Lemur Ave"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4",
"reviewCount": "250"
},
"name": "GreatFood",
"openingHours": [
"Mo-Sa 11:00-14:30",
"Mo-Th 17:00-21:30",
"Fr-Sa 17:00-22:00"
],
"priceRange": "$$",
"servesCuisine": [
"Middle Eastern",
"Mediterranean"
],
"telephone": "(408) 714-1489",
"url": "http://www.dishdash.com"
}
</script>')
</script>
我想要实现的是能够在第三方属性上嵌入架构(JSON-LD)代码,我对HTML的访问权限有限。现在,HTML被<br>
标记分解。