I have a script that generates a csv file from html table data. The script below forces a download when the link class export is clicked. I would like this to happen automatically when the page loads. Is this something that is possible?
$(".export").on('click', function (event) {
// CSV
var args = [$('#output>table'), 'heartbeat.csv'];
exportTableToCSV.apply(this, args);
// If CSV, don't do event.preventDefault() or return false
// We actually need this to be a typical hyperlink
});