Till Till -4 years ago 72
Javascript Question

js, set not to load the dropped file on browser

I want to have help to check my example.

http://jsfiddle.net/fantill/J3Mms/7/

I just want to simply run alert when file is dropped on the div.

$('#a').on('dropover', function(e){
e.preventDefault();
alert(1);
});


However, when I dropped the file, the browser will just read and change the page to what the file is...

I don't really know what am I missing and how can I figure this problem.

Answer Source

Its dragover not dropover

$('#a').on('dragover', function(e){
    e.preventDefault();
    alert(1);
});

http://jsfiddle.net/J3Mms/8/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download