0

I use the following code to check for HTML5 microdata API support

function supports_microdata_api() {
  return !!document.getItems;
}

but this is not working properly. How can I solve this problem?

Oriol
  • 11,660
  • 5
  • 35
  • 37

1 Answers1

0

Use Modernizr, so you can test it like this:

if (Modernizr.microdata) {
  // Yay, microdata is supported!
}

Nonetheless Chrome and Safari don't seem to support this semantic syntax anymore.

Oriol
  • 11,660
  • 5
  • 35
  • 37