HTML5 DataTransfer detection error in Chrome

倖福魔咒の 提交于 2019-12-08 02:48:12

问题


Trying to detect if files property is supported in DataTransfer Object using Javascript. The following code causes an "Uncaught ReferenceError: DataTransfer is not defined" in Chrome, but IE, Firefox and Safari are all fine.

My code is:

if ("files" in DataTransfer.prototype) {
    alert("supported");
}

Any idea why or an alternative way to determine if the files property is supported?

Thanks


回答1:


Chrome doesn't have a DataTransfer object. It has the Clipboard object.



来源:https://stackoverflow.com/questions/3828183/html5-datatransfer-detection-error-in-chrome

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!