Files
tagslice/tagslice.js

35 lines
678 B
JavaScript
Raw Normal View History

2017-06-12 05:55:42 +00:00
'use strict';
class TagSlice {
constructor(container) {
this.buildDom_(container);
this.loadJson_();
}
buildDom_(container) {
let outer = document.createElement('outer');
container.appendChild(outer);
let taglist = document.createElement('taglist');
outer.appendChild(taglist);
taglist.innerText = 'tag!';
let objectlist = document.createElement('objectlist');
outer.appendChild(objectlist);
}
loadJson_() {
2017-06-12 06:01:58 +00:00
let xhr = new XMLHttpRequest();
xhr.open('GET', 'tagslice.json');
xhr.responseType = 'json';
xhr.onload = () => {
this.onJsonLoad_(xhr.response);
2017-06-12 06:01:58 +00:00
};
xhr.send();
2017-06-12 05:55:42 +00:00
}
onJsonLoad_(response) {
console.log('foo', response);
}
2017-06-12 05:55:42 +00:00
}