10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-26 14:23:42 +01:00
QUESTDB_website/static/js/downloadData.js

12 lines
307 B
JavaScript
Raw Normal View History

2019-11-09 17:40:37 +01:00
function downloadData(data,fileName) {
const url=window.URL.createObjectURL(data)
const a = document.createElement('a');
a.style.display = 'none';
a.href = url;
a.download = fileName;
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
document.body.removeChild(a)
}