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);
getMDProperties('',md[i].properties);
}
And the output, as you can see for yourself in ch05/microdata-api-
2.html, is more like you want:
Found: http://microformats.org/profile/hcard
fn: A. J.
n/given-name: A
n/family-name: J
photo: http://www.userfriendly.org/cartoons/miranda/headshot_aj.gif
email: aj@userfriendly.org
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://
microformats.org/profile/hcalendar#vevent vocabulary.
Search WWH ::




Custom Search