title: JQuery: 'Uncaught TypeError: Illegal invocation' at ajax request
body: <p>I am using this AJAX function to post my form to a specific URL .It is getting to the required URL and processing but when it it return the result it is giving error.</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
      //var formm = &quot;&quot;;
      $(&quot;#UploadnForm&quot;).bind(&quot;submit&quot;, function () {
           $('#UploadnForm input[type=&quot;submit&quot;]').attr('disabled', true);
          form = $(this);
          $.ajax({
              type: &quot;POST&quot;,
              cache: false,
              url: $(this).attr('action'),
              enctype: 'multipart/form-data',
              data: new FormData(this),
               success: function (data) {
                  alert(&quot;helo&quot;);
                  if (data.success == true) {
                      alert(&quot;The image is Uploaded&quot;);
                  }
              },
              error: function () {
                  alert(data.error);
              }
  
          });
         
  
      });
  &lt;/script&gt;
         
          
   
  </code></pre>
  <p>But I am getting error:</p>
  <blockquote>
  <p>illegal invocation</p>
  </blockquote>
  <p>while I return the result.</p>