title: Stop sending ajax request without page refresh
body: <p>I created ajax request that sends some data to php file on button click event. Now after submitting data I want to restrict the ajax request not to send the data again and again by clicking the button. It sends the data only on  page refresh ( means send data one time on page load ). How can I stop such requests. My ajax code is as follow :</p>
  
  <pre><code>$(".button").click(function (e) {
      e.preventDefault();
      $.ajax({
          type: 'post',
          cache: false,
          url: 'my/ajaxrequest.php',
          data: {
              result: 'hi test data'
          },
          success: function (resp) {
              $("#result").html(resp);
          }
      });
  });
  </code></pre>