title: clear FormData() in a javascript function
body: <p>I have the following function for uploading images to a server using jQuery Ajax:</p>
  
  <pre><code>function(file,f){
      data = new FormData();
      var ids = file[f].name._unique();
      data.append('file',file[f]);
      data.append('index',ids);
      $(".dfiles[rel='"+ids+"']").find(".progress").show();
      $.ajax({
          type:"POST",
          url:this.config.uploadUrl,
          data:data,
          cache: false,
          contentType: false,
          processData: false,
          success:function(rponse){
              //Success stuff here
              });
      });
  }
  </code></pre>
  
  <p>In the section with <code>data.append('file', file[f]);</code> we're appending stuff to <code>data</code>. I'd like to be able to clear everything out from <code>data</code> from a different function. Is this possible? 
  I could define <code>data</code> as <code>window.data</code> to make it global, but what would I do from there?</p>