Microdata

From ActiveArchives
Jump to: navigation, search

Resources

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();
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox