加载csv文件到jQuery? [英] Loading csv file into jQuery?
问题描述
我有一个CSV文件,我想用作jQuery flot图的源数据。
应该:
- 找到一个可加载CSV文件的jQuery插件
- ol>
- Find a jQuery plugin that will load the CSV file directly?
- Convert the CSV file into JSON and use that instead?
- Do something completely different?
我没有太多运气找到一个jQuery插件可以处理外部CSV文件,但也许我错过了一些东西。
使用jQuery CSV插件获取数组。
它刚刚发生,我可能会想到用jQuery读取一个平面的CSV文件。这是不可能的。让javascript访问文件系统听起来像一个可怕的想法。但您可以始终使用 $。get()
在服务器上加载文件。
I have a CSV file that I would like to use as source data for a jQuery flot graph.
Should I:
I'm not having much luck finding a jQuery plugin that can cope with an external CSV file, but maybe I'm missing something.
Use the jQuery CSV plugin to get an array. Build / sort the array however you need for the chart.
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.
这篇关于加载csv文件到jQuery?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!