title: How to avoid the ajax done click in this case
body: <p>Initially during page load I am making an AJAX call and once it completes I am raising a <code>click</code> event for showing default data for the <code>1D</code> tab. If the user presses the <code>1W</code> tab while the data for <code>1D</code> is loading how can I avoid the done call present under the initial AJAX call? This is my code:</p>
  
  <pre><code>$(document).ready(function() {
      doAjaxcallfordatafetch();
  
      $("ul.menu li").click(function() {
          var tabclicked = $(this).find("a").attr("href");
          doAjaxcallfordatafetch(tabclicked);
      });
      $("ul.menu li a:first").click();
  });
  
  function doAjaxcallfordatafetch(tabclicked) {
      // doing an ajax call and once ajax call completes (done call)
      // i am doing $("ul.menu li a:first").click();
  }
  </code></pre>
  
  <p><a href="https://jsfiddle.net/gr1L23us/11/" rel="nofollow">https://jsfiddle.net/gr1L23us/11/</a></p>