| Server IP : 127.0.1.1 / Your IP : 127.0.0.1 Web Server : Apache/2.4.52 (Ubuntu) System : Linux sealall 5.15.0-179-generic #189-Ubuntu SMP Tue May 5 18:20:56 UTC 2026 x86_64 User : devops ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/domains/sealall.ca/wp-content/plugins/independent-analytics/javascript-source/ |
Upload File : |
function downloadCSV(fileName, data) {
const BOM = '\uFEFF' // UTF-8 byte-order mark (BOM)
const blob = new Blob([BOM + data], { type: 'text/csv;charset=utf-8' })
const element = window.document.createElement('a')
element.href = window.URL.createObjectURL(blob)
element.download = fileName
document.body.appendChild(element)
element.click()
document.body.removeChild(element)
}
function downloadJSON(fileName, data) {
const blob = new Blob([data], {type: 'application/json'})
const element = window.document.createElement('a')
element.href = window.URL.createObjectURL(blob)
element.download = fileName
document.body.appendChild(element)
element.click()
document.body.removeChild(element)
}
module.exports = {downloadCSV, downloadJSON}