title: Read CSV file into a string using jquery
body: <p>I need to select a csv file from local file system and display the contents of that file as text using jquery.</p>
  
  <p>I am using this for file Upload</p>
  
  <pre><code>&lt;input id = "uploadCSV" type = "file" /&gt; 
  </code></pre>
  
  <p>On its change event,</p>
  
  <pre><code> $('#uploadCSV').change(function(e) {
   if(e.target.files != undefined) {
             var reader = new FileReader(); 
             reader.onload = function(e) {
             var lineSplit = e.target.result.split("\n");
             var commaSplit = lineSplit[0].split(",");
             var content = "";
             for(var i = 0; i &lt; commaSplit.length; i++) {
                   var temp = commaSplit[i];
                   content = content + " " + temp;
             }
           };
           reader.readAsText(e.target.files.item(0));
           var fileContent = reader.result;
           alert(fileContent);
        }
   });
  </code></pre>
  
  <p>Somehow this doesn't work and I get null in alert when I use Firefox. If I use IE8, it crashes as it cannot locate e.target.result. Please advise</p>
  
  <p>I am looking for the simplest way of converting a csv file in my local file system into plain text.</p>
  
  <p>Thanks</p>