title: JavaScript Multiple Callback Function
body: <p>I have been trying to figure out the Callback function feature in Javascript for a while without any success. I probably have the code messed up, however I am not getting any Javascript errors, so I supposed the syntax is somewhat correct.</p>
  
  <p>Basically, I am looking for the getDistanceWithLatLong() function to end before the updateDB() begins, and then make sure that ends before the printList() function begins.</p>
  
  <p>I have it working with a hardcoded "setTimeout" call on the functions, but I am overcompensating and forcing users to wait longer without a need if the Callback stuff would work.</p>
  
  <p>Any suggestions? Below is the code:</p>
  
  <pre><code>function runSearchInOrder(callback) {
      getDistanceWithLatLong(function() {
          updateDB(function() {
              printList(callback);
          });
      });
  }
  </code></pre>