HTML and CSS Reference
In-Depth Information
property is passed in as a parameter so the function can list that along-
side its child properties. Now the loop is greatly simplified:
var md = document.getItems();
for (var i = 0; i < md.length; i++) {
log('Found: ' + md[i].itemType);
And the output, as you can see for yourself in ch05/microdata-api-
2.html, is more like you want:
fn: A. J.
n/given-name: A
n/family-name: J
Using multiple microdata formats
To finish this short exploration of the microdata API , let's consider what
you might do with a more complex page that has multiple types of
microdata items available. In ch05/microdata-api-3.html, an additional
hCard has been added as well as an event using the http:// vocabulary.
Search WWH ::

Custom Search