This works:
var picdrag = document.getElementById('picdrag');
picdrag.addEventListener('drop', picSelect, false);
function picSelect(e) {
var pics = e.dataTransfer.files;
}
This doesn’t:
$('#picdrag').on('drop', function(e) {picSelect(e);});
function picSelect(e) {
var pics = e.dataTransfer.files;
}
because it reports an error 'e.dataTransfer is undefined'. I hate it when I don’t know why something works or doesn’t work. This is specific to the drop event, like jQuery handles it differently.
You can try:
From the docs:
There is also an example that should be of interest: