Problem description:
I'm making a post request inside of $.each loop:
$.each(companies, function() {
appAPI.request.post({
url: url,
postData: postdata,
onSuccess: onSuccess(),
onFailure: onFailure()
});
})
The syntax (I'm using crossrider.com API) is similar to jQuery, but still different - 'post' method doesn't have 'timeout' option. How can I check if it takes more than 3 seconds to receive a response, and if it is - abandon this request (don't call onSuccess() function)?
jQuery here can be used too, but I have to do appAPI.request.post instead of $.post for some reasons.