-1

I finally made it through scraping some data out to csv, sending it to get geo encoded and then dumped back out to a new csv with the new columns.. after all that what I can't figure out is how to use some javascript to get the csv data in to an array or object on the page.. can anyone point me in a fairly simply direction?

Garin
  • 25
  • 5
  • I spent forever looking at this example, and honestly I know nothing about javascript.. how does CSV get a value in that example? – Garin Aug 03 '14 at 03:26

1 Answers1

0

1) Use a csv to json converter

2) Copy and paste the generated json into a script tag in your html

<script type='text/javascript>
   window.data = [
      // paste here
   ];
</script>

3) Use the window.data variable in your scripts.

4) Profit.

This is really simple, but your question didn't specify the need for anything more robust. No dependencies. Up and running fast.

Dane O'Connor
  • 75,180
  • 37
  • 119
  • 173
  • thanks for providing some sort of answer instead of just blowing me off.. I went ahead and used the json converter and am loading it in using $.getJSON('auction.json'); – Garin Aug 03 '14 at 16:52
  • Yeah I disagree with the close. You weren't asking to parse the CSV in javascript necessarily. You wanted a strategy for loading it. – Dane O'Connor Aug 04 '14 at 16:45