我正在尝试使用 HTML5 实现基本的拖放功能。它在 Chrome 中工作得很好,但在 IE10 中我得到一个 0x8000ffff - JavaScript runtime error: Unexpected call to method or property access.
error in the line setData
.
function handleDragStart(e) {
e.dataTransfer.effectAllowed = 'move';
e.dataTransfer.setData("dropTarget", g.destination);
}
var cols = $("#" + g.source + " tbody > tr");
[].forEach.call(cols, function (col) {
col.addEventListener('dragstart', handleDragStart, false);
});
我做错了什么?
最佳答案
对于那些正在寻找答案的人:
getData() 和 setData() 属性必须准确地称为“文本”,因为您可以在其他浏览器中使用任何参数(这实际上很有意义 - IE 再次摇滚),这里的其他答案是无用的。
关于javascript - Internet Explorer 中的 HTML5 拖放问题(无法访问 dataTransfer 属性),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26213011/