title: make a part of AJAX call dynamically
body: <p>I have a function which processes different kind of data.</p>
  <p>For that it's necessary to add or remove</p>
  <pre><code>&quot;processData: false,
   contentType: false,&quot;
  </code></pre>
  <p>inside the ajax-call.</p>
  <p>My first tries with an array of true/false, failed. How can I do that?</p>
  <p>That's the call which I have to change dynamically</p>
  <pre><code> $.ajax({
         //url: '&quot;.$global['serverurl'].&quot;module/&quot;.$m['ID'].&quot;/code/cms_data.php?job='+jobid+'&amp;ds='+id+'&amp;new='+jobnew+'&amp;refreshid='+refreshid,
         url: '&quot;.$global['serverurl'].&quot;module/&quot;.$m['ID'].&quot;/code/cms_data.php',
         //type: 'PUT',
         type: 'POST',
         data: formData,
         processData: false,
         contentType: false,
         success: function(result) {...
  </code></pre>
  <p>If I try to work with a suggested function (@Lajos Arpad) like this</p>
  <pre><code>function getAJAXcall(processData, contentType, formData, callback) {
      var returnValue = {
         url: '&quot;.$global['serverurl'].&quot;module/&quot;.$m['ID'].&quot;/code/cms_data.php',
         type: 'POST',
         data: formData,
         success: callback
      };
      if (processData === true){ returnValue.processData = processData; }
      if (contentType === true){ returnValue.contentType = contentType; }
      return returnValue;
  }
  </code></pre>
  <p>it won't work - if I code it by hand it will work, so I think in the function above is a little error?</p>
  <pre><code>function getAJAXcall(processData, contentType, formData, callback) {
      var returnValue = {
         url: '&quot;.$global['serverurl'].&quot;module/&quot;.$m['ID'].&quot;/code/cms_data.php',
         type: 'POST',
         data: formData,
  
         processData: false,
         contentType: false,
  
         success: callback
      };
      return returnValue;
  }
  </code></pre>