What format (MIME Type) should I use for HTML5 drag and drop operations?

前端 未结 3 851
你的背包
你的背包 2020-12-30 00:43

I\'m starting to experiment with HTML5 Drag and Drop. Then, in the dragstart event handler we should run setData(), which receives two parameters: format

3条回答
  •  一整个雨季
    2020-12-30 00:52

    Use 'application/json' as a wrapper for any other metadata that you may like, including mime-type of linked files, or the html you want to use in the browser.

    { 'assets': [
          {
           'color': 'foo',
           'text': 'bar',
           'uri': 'http://', // location of asset
           'type': 'application/zip', // mime-type of asset
           'html': '
    html representation
    ' // .. more properties } // ...more assets ] }

提交回复
热议问题