Hi everyone, I need some help. I create a javascript code ( I call this is A), and a function call a form ajax request -> this will return true or false after ajax running( I call this is B). Now I want A run function B, and if B return true A will run function A.1 and false will run A.2. But I have a issue the B function it alway return false because it not return after ajax request. Thanks!
My code:
function B(){
$('#form-information').request('onSubmitForm', {
complete: function(data) {
if(JSON.parse(data.responseText).success=="true")
return true
return false
}
})
return false;
}
Last updated