jquery synchronous functions

前端 未结 5 920
攒了一身酷
攒了一身酷 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:29

    The question is a bit vague.

    If your functions have asynchronous bits to them, then use callbacks. That's what they are for.

    If, however, you want to do aspect-oriented programming in JavaScript, take a look at jQuery-aop.

提交回复
热议问题