title: Create a custom callback in JavaScript
body: <p>All I need to do is to execute a callback function when my current function execution ends.</p>
  
  <pre><code>function LoadData() 
  {
      alert('The data has been loaded');
      //Call my callback with parameters. For example,
      //callback(loadedData , currentObject);
  }
  </code></pre>
  
  <p>A consumer for this function should be like this:</p>
  
  <pre><code>object.LoadData(success);
  
  function success(loadedData , currentObject) 
  {
    //Todo: some action here 
  }
  </code></pre>
  
  <p>How do I implement this?</p>