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

前端 未结 29 1700
没有蜡笔的小新
没有蜡笔的小新 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:38

    I would recommend using a library like PapaParse: https://github.com/mholt/PapaParse

    The accepted answer currently has multiple issues including:

    • it fails if the data contains a comma
    • it fails if the data contains a linebreak
    • it (kind of) fails if the data contains a quotation mark

提交回复
热议问题