jquery synchronous functions

function, jquery, synchronous

Solution

If your `doSomething()` function is doing something asynchronously (such as making an Ajax request) then you'll want to make `doSomethingElse()` the callback for that asynchronous request, rather than having it execute immediately after `doSomething()` returns.

Problem

Is there a way to run a function after another functions completes? For example: ``` doSomething(); doSomethingElse(); ``` i only want doSomethingElse() to run after doSomething completes. is this possible?

Original source

Related problems