Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
171
rated 0 times [  178] [ 7]  / answers: 1 / hits: 41804  / 12 Years ago, wed, december 19, 2012, 12:00:00

chrome throw err: Cannot call method 'setData' of undefined,
I find the e is not equal to window.event(it havn't propert dataTransfer);both has very big different



I find both almost equal in the click event.



I used http://code.jquery.com/jquery-latest.js.



I don't use drag feature,I just want know why.
it is new feature in html 5,jquery still behind of it ?.
or jquery team don't want support it?? or some other reason


More From » jquery

 Answers
59

In the callback function you get a jQuery wrapper over a native event. Use the originalEvent property of passed argument:



$('...').on('dragstart', function (event) {
event.originalEvent.dataTransfer.setData('...', '...');
});


P.S. dont' forget to set the draggable=true attribute for the element to be dragged.


[#81336] Tuesday, December 18, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
skyler

Total Points: 646
Total Questions: 119
Total Answers: 96

Location: Bonaire
Member since Wed, Mar 29, 2023
1 Year ago
;