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

前端 未结 29 1665
没有蜡笔的小新
没有蜡笔的小新 2020-11-21 21:55

I know there are lot of questions of this nature but I need to do this using JavaScript. I am using Dojo 1.8 and have all the attribute info in array, which loo

29条回答
  •  无人及你
    2020-11-21 22:31

    A lot of roll-your-own solutions here for converting data to CSV, but just about all of them will have various caveats in terms of the type of data they will correctly format without tripping up Excel or the likes.

    Why not use something proven: Papa Parse

    Papa.unparse(data[, config])
    

    Then just combine this with one of the local download solutions here eg. the one by @ArneHB looks good.

提交回复
热议问题