Skip to content

Instantly share code, notes, and snippets.

@dnasca
Created December 7, 2015 20:13
Show Gist options
  • Save dnasca/a19e83269ef8ee49443e to your computer and use it in GitHub Desktop.
Save dnasca/a19e83269ef8ee49443e to your computer and use it in GitHub Desktop.
papa parse. upload parse and populate list
//parse and populate list
function handleFileSelect(e) {
var file = e.target.files[0];
Papa.parse(file, {
header: true,
dynamictyping: true,
complete: function (results) {
parsed = results; //remove on prod
//generate list
$.each(results.data[0], function (key, val) {
$('#pool').append('<li class="list-group-item">' + val + '</li>');
});
onFileSelected();
},
error: function (err) {
alert(err);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment