I have this function where many parts of my code call it.
function test() {
$.ajax({
url : url,
type : 'GET',
success : {
verifyID();
verifyName();
verifyBlah();
}
});
}
and I have this other function:
addProductCart(productID);
Before I call addProductCart()
, I need to call test function, but, other processes call test function.
I'd like to do this:
test() ---> if test ok (success) ----> addProductCart()
But I can't set my function (addProductCart) into success test function because, like I said, many other processes call test function.
How can I do this?