Javascript asynchronous function
<p>i have a problem understanding how this could/should be solved.</p>

<p>I have two functions. In the first function ( I call it loadData() ) I'm doing an asynchronous request to the server to load some data.</p>

<p>In the second function ( saveData() ) I'm also doing an asyn request to the server to write some data. In the callback of this request I'm callin loadData() to refresh the data.</p>

<p>Now the problem: In the saveData() function I want to wait for loadData() to be finished bevore I show a dialog (like alert('Data saved'))</p>

<p>I guess this is a common problem, but I couldn't find the solution for it (if there is one..)</p>

<p>A solution would be to make the requests synchronous, but the framework I'm using doesn't offer that and I hope there's a better solution..</p>

<p>Thanks to all!</p>
