title: Declare one Ajax Function and fill it with different variables
body: <p>I'm trying to make my page more efficient by using a separated ".js" file and trying to declare multilple used functions only one time. So I have to declare them in a way, that they caa be used for different situations. For Example passing different data.</p>
  
  <p>Here is my Ajax Function in the "functions.js" file:</p>
  
  <pre><code>function CallAjax(type, url, data, div){
  
  $.ajax({
          type: type,
          url: url,
          data: data,
          success: function (data) {
              console.log(data);
              $(div).html(data);
          }
      });
  }
  </code></pre>
  
  <p>Here is my Code in my PHP File where I use this function and pass Parameters:</p>
  
  <pre><code>CallAjax('POST', 'about.php', '{ aufid : id }', '#con2');
  </code></pre>
  
  <p>My Problem is the "data" section. How can I declare it? The way I'm doing it doesn't work.</p>
  
  <p>I don't want to use a new Ajax Function everytime when I need different data... I'm trying to trigger less functions as possible. </p>
  
  <p>If you have any tips to make the page more efficient by trying to use less code, then it would be awesome if you mention them, too! Thank you!</p>