I have a web page which shows some data. I would like to give the user the ability to export that data they see as CSV files or PDF files or other formats.
is it technically possible to do so purely by javascript ?
Thanks
I have a web page which shows some data. I would like to give the user the ability to export that data they see as CSV files or PDF files or other formats.
is it technically possible to do so purely by javascript ?
Thanks
To a certain extent this can be resolved:
here is a link which triggers a 'save as' download:
<a href="data:application/octet-stream;charset=utf-8;base64,Zm9vIGJhcg==">text file</a>
so the trick is to use data:application/octet-stream;
note however that it is not possible to specify the extension of the filename/resource you would save (e.g. report.csv)