I have local html file with javascript code.
I should cover drag & drop by tests.
It uses only IE.
In javascript code event "drop" is caught and content of dataTransfer (e.dataTransfer.getData("Text")) is analysed.
In test I simulate event with next code:
event = document.createEventObject();
Here event which contains dataTransfer == null is created.
Write is impossible, because property is read only.
target.fireEvent("ondrop", event);
Event is fired in javascript code, but dataTransfer is null.
I should put some test element in dataTransfer.
How can I resolve this problem?
You could try using the CustomEvent interface, I'm not sure if it works in IE though.
var event = new CustomEvent('build', { 'detail': elem.dataset.time });
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.