我正在使用jQuery 1.9.1.我有一个自定义函数,它执行一些操作然后执行$ .ajax调用.我想按顺序调用这个函数.我试过$ .when,但它并没有解决我的问题.
function func(param) {
//some operations
$.ajax()
}
main() {
//first call
func(param1);
//wait for done and the run the second
func(param2);
}
Run Code Online (Sandbox Code Playgroud)