javascript - HTML5 Drag and drop bug in chrome -
i trying implement drag , drop feature in website, after few hours of trying came conclusion there bug in chrome, example try example , see self.
it seems datatransfer
property doesn't exist therefore i'm getting undefined error.
here code:
$(document).on("dragover", "#dropfile", function(e){ e.datatransfer.setdata('text/x-example', 'foobar'); //error return false; }); $(document).on("drop", "#dropfile", function(e){ e.preventdefault(); console.log(e.datatransfer); //error });
p.s work in firefox.
i've been dabbling drag-drop lately, , primary browser chrome , things work great far. method use wire events bit different yours
$(".droppable").bind("dragover", function (e) { // stuff here }); $(".droppable").bind("drop", function (e) { // stuff here })
Comments
Post a Comment