the asynchronous choice to be false to induce a synchronous Ajax request. Then your asking will set some information before your Main perform return.
Here's what your code would seem like if modified as suggested:
Here's what your code would seem like if modified as suggested:
beforecreate: function (node, targetNode, type, to) {
jQuery.ajax({
url: 'http://example.com/catalog/create/' + targetNode.id
+ '?name=' + encode(to.inp[0].value),
success: function (result) {
if (result.isOk == false)
alert(result.message);
},
async: false
});
}
<script>
// ...
$.ajax(... async: false ...); // Hey
browser! first complete this request,
// then go
for other codes
$.ajax(...); // Executed
after the completion of the previous async:false request.
</script>