title: Call Ajax on a click event instead of document.ready
body: <p>I have an Ajax call on document.ready function as follows</p>
  
  <pre><code>$(document).ready(function(){
  
          function AjaxCall(HandleData) {
         return $.ajax({
          url: "/ajax_up/",
              type: 'GET',
              dataType: "json",
              success:function(data)
              {
                HandleData(data);
              }
  
      });
  }
        AjaxCall(function(output){
  
          data = JSON.stringify(output);
  </code></pre>
  
  <p>I want to call this though on a click function of a div so that the Ajax call to server is made once i click on it instead of making the call on document.ready
  How do I go about this?
  I want to call it here</p>
  
  <pre><code> $(".reply").click(function (){
  </code></pre>
  
  <p>I have tried to put it inside it like below</p>
  
  <pre><code>$(".reply").ready(function(){
  
              function AjaxCall(HandleData) {
             return $.ajax({
              url: "/ajax_up/",
                  type: 'GET',
                  dataType: "json",
                  success:function(data)
                  {
                    HandleData(data);
                  }
  
          });
      }
            AjaxCall(function(output){
  
              data = JSON.stringify(output);
  </code></pre>
  
  <p>Thanks</p>