Question

When creating and executing a ajax request queue with $.manageAjax, I call ajaxManager.abort();, to abort the entire queue due to error, at which time I get an error stating: q[num] has no properties (jquery.ajaxmanager.js line 75)

Here is the calling code:

var ajaxManager = $.manageAjax({manageType:'sync', maxReq:0});
// setup code calling ajaxManager.add(...)

// in success callback of first request
ajaxManager.abort(); <-- causes error in jquery.ajaxManager.js

There are 4 requests in the queue, this is being called in the success of the first request, if certain criteria is met, the queue needs to be aborted.

Any ideas?

Was it helpful?

Solution

It looks like you've got fewer items in q than you were expecting when you started iterating. Your script may be trying to access q[q.length], i.e. the element after the last element.

Could it be that your successful request has been popped from the queue, and you have a race condition? Are you trying to abort a request that has already completed its life cycle? Alternatively, have you made a silly mistake as people sometimes do, and got your loop termination condition wrong?

Just a few thoughts, I hope they help.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top