10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-25 22:03:49 +01:00
QUESTDB_website/static/js/downloadData.js

12 lines
307 B
JavaScript

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)
}