jquery synchronous functions

前端 未结 5 923
攒了一身酷
攒了一身酷 2021-01-05 23:49

Is there a way to run a function after another functions completes? For example:

doSomething();
doSomethingElse();

i only want doSomethingE

5条回答
  •  情话喂你
    2021-01-06 00:19

    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.

提交回复
热议问题