How to wait for one function to finish before continuing?
<p>I have three functions. The calling hierarchy is like this:</p>

<pre><code>function a() {
    b();
    c();
}

function b() {
    d();
}
</code></pre>

<p>What I want is to finish b then continue doing c. But d is asynchronous. I don't have rights to change anything in b and d. Is there any way to handle this case? Sorry for my English.</p>