presubmite
presubmite
$.ajax({
type: "GET",
data: {"domain":domain.val()},
dataType: "json",
url: '/example/',
cache: false,
timeout:30000,
success: function(returnData) {
console.log(returnData)
console.log("yes")
// domain.error( 'Domain must be valid URL' );
}
});
if ( this.inError() ) {
return false;
}
i m using this in presubmite evevnt but this.inError() execute first before ajax sucess what do ?
Replies
pre-submite event
if ( this.inError() ) {
return false;
}
how to set true after return false
Hi @THEJASVI ,
Yep, it's asynchronous, so the code carries on. You could move your check to
postSubmit
, perhaps,Cheers,
Colin
As on Editor 1.8 you can actually return a promise from the
pre*
event handlers, to cause them to "pause" until you complete the promise.Allan