How to prepare my table data as properties file and download into browser on click of a button.
Hi @anon11502118,
Could you please provide us with more information on what you are trying to achieve?
Do you want to build a button that allows the user to download certain data?
Maybe some example code or explain what you mean with ‘my table data’ and a ‘properties file’.
Cheers,
Peter
@anon11502118 if you are looking for a pure java-script solution (and if i understood your problem correctly, which is hard, because you do not provide any additional context information) you could try the following:
- Use a (User)Macro to place a
<a>
using the download-attribute below the<table>
you want to extract. - Use JavaScript to extract the data from the
<table>
- Format the extracted data to the File-Format of your choice (you mentioned .properties format)
- Use Blob-URL’s to create a “Download-Link” and let the user download the extracted data. Example found on SO: html - Is it possible to write data to file using only JavaScript? - Stack Overflow
i was curious if my suggestions would even work. didn’t work with blob-urls in a while… so i created a JsFiddle for you, it should do, what you wanted (supposed i understood you correctly):
i did not use jQuery, which maybe makes the code more readable, i used mouseover and did not do any encoding of the text-data.
maybe this helps
Thanks for your replies. I already found the solution from below, it is working fine.