Below is the code snippet:
var pendingRequest = new Ajax.Request(myUrl, {
method: 'post',
postBody: soapMsg,
contentType: "text/xml",
onSuccess: function(transport) {
doSomething(transport);
},
onFailure: function(t) {
OnAjaxFailure(t);
},
onException: function(req,exception) {
OnAjaxException(req, exception);
}
});
Is there a way to cancel the request and discard the data? If not, is it possible to differentiate between requests inside my onSuccess method for identification purposes (perhaps using a name/guid)?
I am considering using an array.push(pendingRequest) to track pending requests.
I would like to provide users with the ability to interrupt their request, update input values, and submit again.
Sometimes, the original request finishes after the new one, resulting in outdated data being replaced. For example, 50,000 records are returned in the first query and only 5 in the second.
Thank you.