JSFiddle - React, Tailwind, and code Playground

by Exceeder

HTML

<button onclick="downloadExcel()">start Excel download</button>
<button onclick="downloadExcelBlank()">start Excel download in new window</button>
<button onclick="downloadLog()">start Log download</button>

JavaScript

window.downloadExcel = function() {
    //new window because Excel is not consumable by the browser
    document.location = 'http://xenotex.com/Reading.xls';
}
    
window.downloadExcelBlank = function() {
    //new window for excel just for testing
    window.open('http://xenotex.com/Reading.xls','_blank');    
}
    
window.downloadLog = function() {
    //because logs can be consumed by the browser,
    //we need to open them in a new window/tab
    window.open('http://xenotex.com/test.log','_blank');    
}