Take the 2-minute tour ×  Is there a way to run a function after
another functions completes? For example:   i only want
doSomethingElse() to run after doSomething completes. is this
possible?  share|improve this question Doesn't what you posted
already do what you want? What am I missing here? –  Mark Byers
Nov 21 '09 at 0:40 +1 to counter the -1. This question is as
valid as any other. –  echo Nov 21 '09 at 0:44 Any chance you
can give us more code or tell us what you're trying to do? – 
Nosredna Nov 21 '09 at 1:36 I have the same problem, if anyone
can solve it please reply again. –  Ryan Aug 1 '12 at 10:10 add
comment  5 Answers  up vote 6 down vote accepted  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.  share|improve this answer I am making an ajax request
so this looks like the valid solution to