Download attribute not working in Firefox

前端 未结 1 1906
情深已故
情深已故 2020-11-29 06:38

I\'m trying to let the user download some data as a CSV (text) file, using Javascript and the HTML5 Download attribute (http://caniuse.com/#feat=download).

The data

相关标签:
1条回答
  • 2020-11-29 07:20

    You might try adding the element to the DOM before triggering the click:

    document.body.appendChild(link);
    link.click();
    document.body.removeChild(link);
    

    This worked for me in Firefox 34

    jsfiddle: http://jsfiddle.net/8wos7cf8/7/

    0 讨论(0)
提交回复
热议问题