Ajax request

I would like to ask what is wrong with this code. Thank you for your answers.

Feb.26,2021

ajax is executed asynchronously by default, and you always return false. You can add a parameter {async:false} to Synchronize


feel that you are asking an asynchronous question, and $.ajax plus an async:false


you return false forever.

function a() {
    return $.ajax().then(function(){return true},function(){return false})
}
a().then(function(b) {
    console.log(b)
})
Menu