How to export JavaScript array info to csv (on client side)?

You can do this in native JavaScript. You’ll have to parse your data into correct CSV format as so (assuming you are using an array of arrays for your data as you have described in the question): const rows = [ [“name1”, “city1”, “some other info”], [“name2”, “city2”, “more info”] ]; let csvContent = “data:text/csv;charset=utf-8,”; … Read more

Capture HTML Canvas as gif/jpg/png/pdf?

Original answer was specific to a similar question. This has been revised: let canvas = document.getElementById(“mycanvas”); let img = canvas.toDataURL(“image/png”); with the value in IMG you can write it out as a new Image like so: document.getElementById(“existing-image-id”).src = img; or document.write(‘<img src=”‘+img+'”/>’);