How to determine presence of HTML5 drag'n'drop file upload API (like the one from FF3.6)

前端 未结 8 738
一生所求
一生所求 2020-12-01 04:53

I am writing an application that\'s supposed to support HTML5 drag/drop API for file, much like the on described here. I would like to perform a programmatic check on whethe

8条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 05:15

    I had to make a slight change to dshaw's answer for support in IE8:

    if (!!window.FileReader && Modernizr.draganddrop) {
      // sexy drag and drop action
    } else {
      // no drag and drop support available :(
    }
    

    You can try it out here

提交回复
热议问题