SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function download(filename, text) {
  2.   let element = document.createElement('a');
  3.   element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
  4.   element.setAttribute('download', filename);
  5.  
  6.   element.style.display = 'none';
  7.   document.body.appendChild(element);
  8.  
  9.   element.click();
  10.  
  11.   document.body.removeChild(element);
  12. }
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