websch/method-draw/dragupload.js

11 lines
333 B
JavaScript
Raw Normal View History

2012-07-24 02:30:12 +00:00
window.onload = function () {
document.querySelector('body').addEventListener('drop', function(e) {
e.preventDefault();
var reader = new FileReader();
reader.onload = function(evt) {
//document.querySelector('img').src = evt.target.result;
};
reader.readAsDataURL(e.dataTransfer.files[0]);
}, false);
}