I'm trying to parse a CSV to JSON but I'm always getting results undefined
This is what I have
<input type="file" id="csv-file" name="files"/>
$('input').change(function(e) {
$('input[type=file]').parse({
config: {
// base config to use for each file
},
before: function(file, inputElem)
{
console.log(file);
// executed before parsing each file begins;
// what you return here controls the flow
},
error: function(err, file, inputElem, reason)
{
console.log(err);
// executed if an error occurs while loading the file,
// or if before callback aborted for some reason
},
complete: function(results, file) {
console.log("Parsing complete:", results, file);
}
});
});
I'm trying to parse a CSV to JSON but I'm always getting results undefined
This is what I have