0

I want to read a csv file stored locally on my machine, and assign each value to a javascript variable.

  • The number of values/variables is known (less than 30) and can be hardcoded
  • I plan to use these vars to set some parameters
  • (edit) JQuery is allowed

How do I go about doing this in JS?

Yonatan Galili
  • 208
  • 1
  • 9
  • For a start, you'll need a http server running on your computer, which can server the resource (csv file) you need, with CORS enabled, unless it also serves the webpage that is reading the csv file – Jaromanda X Sep 13 '15 at 14:25
  • 1
    Try something like this http://www.htmlgoodies.com/beyond/javascript/read-text-files-using-the-javascript-filereader.html#fbid=6UGbrFxKBOM – James Jithin Sep 13 '15 at 15:21

0 Answers0