Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addDrawing(url, html, id) {
- var elem = document.createElement('a');
- elem.id = id;
- elem.onclick = function() {tableauClicked(id)};
- fetch(url)
- .then( r => r.text() )
- .then(t => elem.innerText = t)
- html.appendChild(elem)
- }
- function prependDrawing(url, html) {
- fetch(url)
- .then( r => r.text() )
- .then(t => html.innerHTML = t + html.innerHTML);
- }
- function prependDrawing(url, html) {
- fetch(url)
- .then( r => r.text() )
- .then(t => html.insertAdjacentHTML('afterbegin', t));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement