/DOMify

Access Device API data as Documents via the HTML DOM

Primary LanguageJavaScript

DOMify

DOMify republishes information made available through "device APIs" as local HTML documents accessible via a DOM.

Initially, only the navigator.geolocation API is supported via the Geo Document object. Geo location data is stored as a definition list as the only child of the body element.

The two "demos" are available online here; current location, watch changing location

Here's the Javascript code behind the former;

$(Geo).bind('document-updated',function(e) {
  var lat = $(Geo).find('#latitude').text();
  var lon = $(Geo).find('#longitude').text();
  $('#lat').text(lat); $('#long').text(lon);
});

More information about the project is available on the Wiki.