Below is the format of jQuery
function I am using. I need to exit from the entire js-validation
function if condition 3
fails.
I have tried using return false
and return
, However the function is not getting exited , $.post
in the subsequent part is getting executed.
Any help please?
$("body").on("click", ".js-validation", function(event) {
if (condition 1) {
/* doing something*/
} else {
if (condition 2) {
$.get( "abc-json.php",{value:value} ).done(function(data) {
if (condition 3) {
return;
}
}
$.post();
}
});