So let me get this straight. You want to make sure that the results that are brought back are always the latest based on the last change the user made to the checkboxes, correct?
If this is so you can just save the ajax request and abort it on subsequent calls. if the request has already completed it remains unaffected, but if a previous request is still processing while the user clicks a new option, then that previous request gets aborted* and only the newest request gets processed
so you would do something like this
//kill the request
if(xhr){
xhr.abort();
}
var xhr = $.ajax({
//...
});
just make sure the "xhr" variable is in the proper scope so that it is saved.
A trick i usually do is greate "global" variables like such
var APP = {}
APP.Globals = {
xhr:''
}
Then you would use
if(
APP.Globals.xhr){
APP.Globals.xhr.abort();
}
APP.Globals.xhr = $.ajax({
//...
});
*its still processed and responded to on the server, it just doesnt get processed by the client.