title: How do i call a function first and then the second in javascript
body: <p>I want to call <code>checkifPresentInActiveProjLib</code> function first and after that <code>checkifPresentInClosedProjLib</code> function.How do I attain this?</p>
  
  <pre><code>checkifPresentInActiveProjLib(function(flgAc) {
      if (flgAc === "active_found")
          // do something
  
      $.ajax(...); // ajax call
  });
  
  checkifPresentInClosedProjLib(function(flgCl) {
      if (flgCl === "closed_found")
          // do something
  
      $.ajax(...); // ajax call
  });
  </code></pre>