title: Downloading file using javascript not working in Mozilla
body: <p>This how my code works.
  When I clicked the button, it will download the file.
  My code is working in Google Chrome but not working in Mozilla Firefox.</p>
  
  <p>Here are my codes</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;button type='Button' onClick='dlpdf("http://www.energy.umich.edu/sites/default/files/pdf-sample.pdf")'&gt;Download&lt;/button&gt;
  </code></pre>
  
  <p>JAVASCRIPT</p>
  
  <pre><code>function dlpdf(fileURL){
  
      if (!window.ActiveXObject) {
          var save = document.createElement('a');
  
          //alert(fileURL);
  
          save.href = fileURL;
          save.target = '_blank';
          save.download = fileURL || 'unknown';
  
  
          var event = document.createEvent('Event');
          event.initEvent('click', true, true);
          save.dispatchEvent(event);
          (window.URL || window.webkitURL).revokeObjectURL(save.href);
      }
  
  
  }
  </code></pre>