title: Ajax form submit with file upload using jquery
body: <p>I'm trying to submit a form with one text- and one file upload field by ajax using jQuery.</p>
  
  <pre><code>$("#myForm").submit(function() {
      var formData = new FormData($(this)[0]);
      $.ajax({
          url: $(this).attr("action"),
          type: "POST",
          data: formData,
          async: false,
          cache: false,
          contentType: false,
          proccessData: false,
          success: function() {
              // do something smart here
          }
      });
  });
  </code></pre>
  
  <p>On submit, i only got a error <strong>Illegal operation on WrappedNative prototype object</strong>, because the ajax request is trying to send the whole DOM from the form.</p>
  
  <p>How do i send the data correctly?</p>
  
  <p>$(this).serialize() would be the option, if i only want to send text, but i'm trying to send text AND upload a file at the same time.</p>
  
  <p>Thanks for your help!</p>