I have a JavaScript widget that gives standard extension points. One of them is the before creating function. It should return bogus to keep a thing from being made.
I've added an Ajax call into this capacity utilizing jQuery:
beforecreate: function (node, targetNode, type, to) {
jQuery.get('http://example /catalog/create/' + targetNode.id + '?name=' + encode(to.inp[0].value),
function (result) {
if (result.isOk == false)
alert(result.message);
});
}
Be that as it may, I need to keep my gadget from making the thing, so I should return bogus in the mother-function, not in the callback. Is there an approach to play out a simultaneous AJAX demand utilizing jQuery or some other in-program API?