Is sync call block async call callback?

问题内容:

window.f1 = function() {
    console.log('f1')
}

window.f2 = function() {
    console.log('f2')
}

window.f3 = function() {
    console.log('f3')
}

function boo() {
    $.ajax({
        method: 'get',
        url: 'http://localhost/foo',
        success: function (data) {
            window.f1();
        }
    });

    window.f2();

    $.ajax({
        type: "get",
        url: 'http://localhost/foo',
        async: false,
        success: function (data) {
            window.f3();
        }
    });
}

when call boo(), is second Ajax(Sync) call block first Ajax(Async) call callback ?
i.e. the console log always f2, f3, f1
Or, it has a situation, the console log become f2, f1, f3 ??

问题评论:

原文地址:

https://stackoverflow.com/questions/47752795/is-sync-call-block-async-call-callback

Tags:

添加评论

友情链接:蝴蝶教程