I am modifying the following script from here
I am now able to export this table :
<div class='container'>
<div id="dvData">
<table>
<tr>
<th>Column One</th>
<th>Column Two</th>
<th>Column Three</th>
</tr>
<tr>
<td>Row 1 Col 1</td>
<td>Row 1 Col 2</td>
<td>Row 1 Col 3 </td>
</tr>
<tr>
<td>Row 2 Col 1</td>
<td>Row 2 Col 2</td>
<td>Row 2 Col 3</td>
</tr>
<tr>
<td>Row 3 Col 1</td>
<td>Row 3 Col 2</td>
<td>Row 3 Col 3</td>
</tr>
</table>
</div>
by clicking this button :
<div class='button'>
<a href="#" id="export" role='button'>Click On This Here Link To Export The Table Data into a CSV File
</a>
</div>
If above button is clicked, it will run this script:
$("#export").click(function(event) {
var outputFile = '0-test.txt';
exportTableToCSV.apply(this, [$('#dvData>table'), outputFile]);
});
});
And it worked.
Now the aim is to have this table exported and saved/downloaded (without dialog box) every certain defined time/period. In the following script I define every 5 second.
function save() {
$('#export').trigger('click');
}
setInterval(save, 5000);
However the
$('#export').trigger('click');
has no response. Please advise.
complete code