jQuery callback for multiple ajax calls

后端 未结 14 1871
夕颜
夕颜 2020-11-22 09:18

I want to make three ajax calls in a click event. Each ajax call does a distinct operation and returns back data that is needed for a final callback. The calls themselves ar

14条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 09:37

    $.ajax({type:'POST', url:'www.naver.com', dataType:'text', async:false,
        complete:function(xhr, textStatus){},
        error:function(xhr, textStatus){},
        success:function( data ){
            $.ajax({type:'POST', 
                ....
                ....
                success:function(data){
                    $.ajax({type:'POST',
                        ....
                        ....
                }
            }
        });
    

    I'm sorry but I can't explain what I worte cuz I'm a Korean who can't speak even a word in english. but I think you can easily understand it.

提交回复
热议问题