Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function download1(content, fileName) {
- const blob = new Blob([content], { type: 'text/plain' });
- const url = URL.createObjectURL(blob);
- const a = document.createElement('a');
- a.href = url;
- a.download = fileName || 'download.txt';
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
- URL.revokeObjectURL(url);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement