javascript download file

1
2
3
4
5
6
7
8
9
10
const blob = new Blob();

const URL = window.URL || window.webkitURL;
const a = document.createElement('a');
const url = URL.createObjectURL(blob);
a.href = url;
a.download = 'a.txt';
a.click();
a.remove();
a.revokeObjectURL(url);

Comments

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×