title: Run a function on document.ready and onClick
body: <p>Is there a way to make this ajax-response run on document.ready, AND onClik without copy/paste the code in another function?</p>
  
  <pre><code>$(document).ready(function() {
  var ads = $('#ads').val();
  function ajax(){
      $.ajax({
          url: "./services/finn_bilder.php",
          type:"POST",
          data:{ads: ads},
          success:function(data){
              $('#AdsDiv').html(data);
          }
  </code></pre>
  
  <p>I want this to run onClick $('#id').click(function()); and the way its working now, without copy/paste?</p>