digital object javascript API

api/do_api.js provides javascript methods to data objects in the XTF JSONP results

item = new do_api.Item(item);
if (typeof item.data !== 'undefined') {
  var image = item.getImg();
  var caption = item.caption();
  var href = item.href();
}
class do_api.Item(json)
Arguments:
  • json – JSON returned from XTF
Returns:

digital library item object

item.getImg()
Returns:href to image file
item.caption()
Returns:caption to the image (HTML fragment)
item.thumbnail()
Returns:href to thumbnail image
item.href()
Returns:cannonical URL for the object (HTML web page)

Project Versions

Previous topic

CDL Digital Special Collections Contributor Slideshow Widget

Next topic

XTF jsonp result mode

This Page