title: Download javascript data to a file in IE8
body: <p>I have code to download javascript variables as files but it is not working in IE8, how would I do this in IE8?</p>
  
  <pre><code>function download(filename, text) {
      var pom = document.createElement('a');
      pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
      pom.setAttribute('download', filename);
  
      document.body.appendChild(pom)
      pom.click();
  
      // Remove anchor from body
      document.body.removeChild(pom)
  }
  </code></pre>