Created
December 7, 2015 20:13
-
-
Save dnasca/a19e83269ef8ee49443e to your computer and use it in GitHub Desktop.
papa parse. upload parse and populate list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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