10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-07-04 02:16:11 +02: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)
}