title: jQuery.ajax returns html instead of json
body: <pre><code>  echo json_encode($mockImageUrl); //I do this in php
  </code></pre>
  
  <p>In js (just the essence):</p>
  
  <pre><code> formdata.append('variation_id', variation.id);
              formdata.append('image_url', s3_url);
  
              jQuery.ajax({
                  url: 'http://everframe.wordpress.dev/wordpress/wp-admin/admin-ajax.php',
                  type: 'POST',
                  data: formdata,
                  dataType: 'json',
                  processData: false,
                  contentType: false,
                  success: function(data) {
                      console.log(data);
  }
  </code></pre>
  
  <p>and of course the problem is that I get an error "unexpected token.." as it tries to parse html as json. Tried to set  contentType: 'application/json', but it starts returning only 0 without further necessary results. </p>
  
  <p>Yet not sure how I could handle this.</p>