Adding callback functionality to my simple javascript function
<p>I am not writing a plugin. I am just looking for a simple clean way to let myself know when a certain function has finished executing ajax calls or whatever.</p>

<p>So I have this:</p>

<pre><code>function doSomething() {
...
   getCauses("", query, function () {
       alert('test');  
   });
...
}

function getCauses(value, query) {
//do stuff...
}
</code></pre>

<p>Of course the alert never happens. I have a $.ajax call inside getCauses and would like to alert or do some action after getCauses finishes executing and then running the line of code from where the function was called.</p>

<p>Ideas? Thanks.</p>
