title: How to Drag and drop an array
body: <pre><code>document.getElementById('canvas_map').addEventListener(
      'dragstart', function(event) {
      var list_exe_selected=[];
      var image_match=[];
      //[...] code to find images image_match will be an htmlcollection
      list_exe_selected[i]=[];
      for (var j=0; j&lt;image_match.length; j++) {
          var str=image_match[j].href.baseVal;
          list_exe_selected[i].push(str);
      };
      event.dataTransfer.setData('text', list_exe_selected);
  }
  document.getElementById('canvas_map').addEventListener(
      'dragover', function(event) {
      event.preventDefault();
  });
  document.getElementById('canvas_map').addEventListener(
      'drop', function(event) {
      var data = event.dataTransfer.getData('text');
      var list_exe_selected=data.split(',');
      for (var i=1; i&lt;list_exe_selected.length; i++) {
          exe_selected=list_exe_selected[i];
          //do stuff
      };
  };
  </code></pre>
  
  <p>First thing: in <code>dataTransfer.setData</code> <code>text</code> is the data type... good. Which other data type exist??? I can't find. Is there something for array?</p>
  
  <p>Second thing: my <code>list_exe_selected</code> on <code>dragstart</code> is something like this:</p>
  
  <pre><code>[ &lt;1 empty space&gt;, "my_string1", Array[2], &lt;3 empty spaces&gt;, "my_string2"… ]
  </code></pre>
  
  <p>but my <code>data</code> on <code>drop</code> is this:</p>
  
  <pre><code>,my_string,first_element_of_my_array,second_element_of_my_array,,,,my_string2...
  </code></pre>
  
  <p>my array has been 'exploded' in his elements so my <code>list_exe_selected</code> do not have the same index like before and this is the problem...</p>
  
  <p>Is there an easy way to resolve this problem? I could rebuild the array manually but maybe is possible to transfer the data without losing the format or is possible to pass more than one set of data...</p>
  
  <p>Edit:
  I can be wrong but at last it look like you can't pass array directly.</p>