All I need to do is to execute a callback function when my current function execution ends.
function LoadData() { alert(\'The data has been loaded\');
Try:
function LoadData (callback) { // ... Process whatever data callback (loadedData, currentObject); }
Functions are first class in JavaScript; you can just pass them around.