Get started with jquery-csv CDN

MIT licensed

JQuery-CSV: Read/write CSV files in JS with jQuery.

Tags:
  • jquery
  • csv

Stable version

Copied!

How to start using jquery-csv CDN


$(document).ready(function() {
  // Assuming the CSV data is in a file named 'data.csv' in the same directory
  $.get('data.csv', function(data) {
    var csv = new Papa.Parser().parse(data, { header: true });

    // Assign the parsed CSV data to a variable for further processing
    var csvData = csv.data;

    // You can now manipulate the CSV data using jQuery and other libraries
    // For example, let's print the values of the first column in the first row
    console.log($(csvData[0][0]));

    // Or, you can convert the CSV data to a JSON object and manipulate it that way
    var jsonData = $.csv.toArrays(csv.data[0]);
    console.log(jsonData[0]);
  });
});
Copied!
Copied!

All versions