Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js download

function downloadText(filename, text) {
    Object.assign(document.createElement('a'), {
      download: filename,
      href: 'data:text/plain;charset=utf-8,' + encodeURIComponent(text),
    }).click()
  }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #download
ADD COMMENT
Topic
Name
8+7 =