From the course: JSON Essential Training

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Add a JSON-LD snippet to a web page

Add a JSON-LD snippet to a web page - JavaScript Tutorial

From the course: JSON Essential Training

Add a JSON-LD snippet to a web page

- [Instructor] JSON-LD has a variety of uses. Perhaps the most common way that many of us consume JSON-LD content is on the web where JSON-LD snippets may be displayed as part of search results. Adding JSON-LD to a webpage uses the same script tags that are used for JavaScript. However, while the JavaScript file type is application/javascript, the type for JSON-LD is application/ld+json. An HTML document contains two main sections, the head and the body. The head contains information about the page, while the body section includes the content that is rendered by a browser, or other user agent, and presented to the user. The JSON-LD goes in the head section. The snippet.jsonld file, for this video, contains a snippet for the H+ Sport Company. I want to add this to the product page for the company website, so search engines can use the information when indexing the site. So opening up the products.html file, at the very top…

Contents