Abort SPServices Requests

Jan 23, 2012 at 7:17 AM

Hi,

within a project I'm currently using SPServices to pull some Items from a List. Everything is working fine, but depending on the filters the query could take a while. I tried to add an abort functionality to the request. 

In a plain jQuery solution i would use the beforeSend parameter to store the current request instance, which could easily be aborted from everywhere else. But SPServices doesn't offer this property.

So at bottom line my question is if there is an existing way to abort a SPServices request?

Coordinator
Jan 24, 2012 at 1:23 PM
Thorsten:

I don't know of a way to tell the server to stop working on the request. However, if you wrap the call in a timer, you can just time out and then move on and do something else. The server may send the response, but you just won't "catch" it.

If you think that beforeSend is something you should be able to pass in and can give me an example, I can think about how to implement it. I do use the beforeSend to help with anonymous users and I just need to make sure to combine things reliably.

M.