` In A `head` Section Do?","text":"I got this link but didn't understand well. saw: <script ...","answerCount":1,"upvoteCount":30,"acceptedAnswer":{"@type":"Answer","text":"In your example, the script element is used as data block, which contains JSON-LD (type=\"application/ld+json\"). JSON-LD is a RDF serialization. It allows you to publish Linked Data (or structured dat","upvoteCount":30,"url":"http://tutorialmeta.com/question/whats-a-script-type-application-ldjsonjsonobj-script-in-a-head-sec"},"suggestedAnswer":[]}} What's A `<script Type='application/ld+json'>{jsonObj}</script>` In A `head` Section Do?
Ad

What's A `` In A `head` Section Do?

- 1 answer

I got this link but didn't understand well. Saw:

<script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "WebSite",
    "url": "http://website.com",
    "name": "wbs",
    "description": "Web Studio"
}
</script>

in a source code.

How a code snippet like above in my website header help me or my site?

Ad

Answer

In your example, the script element is used as data block, which contains JSON-LD (type="application/ld+json").

JSON-LD is a RDF serialization. It allows you to publish Linked Data (or structured data) using JSON. In your example, the vocabulary Schema.org is used ("@context": "http://schema.org").

This structured data can be used by any interested consumer. Prominent consumers are the search engines Bing, Google, Yahoo, and Yandex, which support structured data that uses the vocabulary Schema.org. One use case they have is displaying more details in their result snippets.

Your example probably doesn’t lead to such an enhanced snippet. You have to check the search engine’s documentation if you want to know what features they offer and which structured data you have to provide for these. For example, Google uses the WebSite type (that’s used in your example) for their Sitelinks Search Box, but you would have to add a potentialAction in addition (for the search function).

Ad
source: stackoverflow.com
Ad