Skip to content

Instantly share code, notes, and snippets.

View Lars418's full-sized avatar
🍵
I may be slow to respond.

Lars Lars418

🍵
I may be slow to respond.
View GitHub Profile
@joeyguerra
joeyguerra / schema.js
Last active April 8, 2022 15:14
Schema.org microdata parser in Javascript for the client side.
(function(win){
/*
Copied from https://github.com/foolip/microdatajs/blob/master/jquery.microdata.json.js
without jQuery.
*/
var Schema = (function(doc){
function getTypes(node){
var type = node.getAttribute('itemtype');
if(!type) return [];
return type.split(' ');