Microdata
From ActiveArchives
Resources
- http://en.wikipedia.org/wiki/Microdata_%28HTML%29
- http://dev.w3.org/html5/md/
- http://www.w3.org/TR/html5/microdata.html
- http://philip.html5.org/demos/microdata/demo.html (this is kind of out of date)
Sample code
Exploring the DOM api as implemented by MicrodataJS jQuery plugin.
The MicrodataJS jQuery plugin provides a set of methods simulating the functionality of the DOM-api:
- items( [types] )
- properties( [name] )
- itemValue()
It's a little awkward in that you need to keep wrapping items with jQuery to use the custom methods, but other than that it makes sense. It's actually really cool that you get access to the actual DOM elements AND the linked data indirectly.
var items = $("body").items();
var props = $(items[0]).properties();
var value = $(props[0]).itemValue();