SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function addDrawing(url, html, id) {
  2.   var elem = document.createElement('a');
  3.   elem.id = id;
  4.   elem.onclick = function() {tableauClicked(id)};
  5.   fetch(url)
  6.   .then( r => r.text() )
  7.   .then(t => elem.innerText = t)
  8.   html.appendChild(elem)
  9. }
  10.      
  11. function prependDrawing(url, html) {
  12.   fetch(url)
  13.   .then( r => r.text() )
  14.   .then(t => html.innerHTML = t + html.innerHTML);
  15. }
  16.      
  17. function prependDrawing(url, html) {
  18.   fetch(url)
  19.   .then( r => r.text() )
  20.   .then(t => html.insertAdjacentHTML('afterbegin', t));
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top