javascript - HTML5 D&D loosing dataTransfer data, please advise -


i made small demo data attached via datatransfer lost. here code example:

var element = document.getelementbyid('draggable'); element.addeventlistener('dragstart', function (evt) {     evt.stoppropagation();     evt.datatransfer.effectallowed = 'move';     evt.datatransfer.setdata('test', 'some_dummy_data'); } );  var zone = document.getelementbyid('dropzone'); zone.addeventlistener('dragenter', function (evt) {     evt.stoppropagation(); evt.preventdefault();     console.log( '>>>', evt.datatransfer.getdata( 'test' ) ); } ); 

http://jsfiddle.net/u24sc/33/

any appreciated.

"note: security purposes, getdata method can called within ondrop event handler."

reference: apple


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -