drag and drop not working in IE - Javascript, HTML5

后端 未结 4 1747
自闭症患者
自闭症患者 2020-12-19 11:09

I\'ve built this checker-board app which uses HTML5\'s Drag&Drop with javascript. It works great on chrome and firefox, but not on IE9 or IE8. My guess is that the probl

4条回答
  •  我在风中等你
    2020-12-19 11:42

    Use "text" instead of "text/html"

    e.dataTransfer.setData("text", this.innerHTML);
    

    See this article for explanation

    Even though Internet Explorer started out by introducing only "text" and "URL" as valid data types, HTML5 extends this to allow any MIME type to be specified. The values "text" and "URL" will be supported by HTML5 for backwards compatibility, but they are mapped to "text/plain" and "text/uri-list".

提交回复
热议问题