title: Need to replace my data from json to csv file
body: <p>I'm working with json file but I need to replace it with csv file. Do I need to use a library to do that or can I change the jQuery get from json to csv? I've tried that but no luck not working.</p>
  
  <p>My javascript code is th</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
   $.ajax({
    url: 'somefile.json',
    type: "GET",
    dataType: "json",
    success: function (data) {
     $(".score-text").each(function( index, value ) { 
            value.innerText = data['box'+(index+1)].total;
        });
      
        $(".data").each(function( index, value ) {  
            var boxIndex = Math.floor(index/4);
            width = data['box'+(boxIndex+1)]['bar'+(index+1-boxIndex*4)];
            value.innerText = width;
            value.style.width = width;
        });
    }
   });   
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>I'm using csv to array but getting some errors this is my code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
   $.ajax({
       url: "somefile.csv",
       success: function (csvd) {
           data = $.csv2Array(csvd);
       },
       dataType: "text",
       complete: function (data) {
           $(".score-text").each(function( index, value ) { 
            console.log(data);
            value.innerText = data['box'+(index+1)].total;
        });
      
        $(".data").each(function( index, value ) {  
            var boxIndex = Math.floor(index/4);
            width = data['box'+(boxIndex+1)]['bar'+(index+1-boxIndex*4)];
            value.innerText = width;
            value.style.width = width;
        });
       }
   });  
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks</p>