Loading csv file into jQuery?

前端 未结 2 1000
礼貌的吻别
礼貌的吻别 2021-02-04 15:37

I have a CSV file that I would like to use as source data for a jQuery flot graph.

Should I:

  1. Find a jQuery plugin that will load the CSV file directly?
2条回答
  •  醉酒成梦
    2021-02-04 16:21

    Use the jQuery CSV plugin to get an array. Build / sort the array however you need for the chart.

    jQuery CSV Plugin

    It just occured to me you may be thinking of reading a flat CSV file with jQuery. That's not possible. Giving javascript access to the filesystem sounds like a terrible idea. You can always use $.get() to load a file on a server, though.

提交回复
热议问题