How how do I delete a jQuery Deferred from an array when it finishes? I have:
myarray[key]=$.ajax({
}).done(function(response){
// work with response,
// then delete myarray[key];
});
This does not work:
var myvar=function(){
if(myvar){
alert(1);
}
}
Seems like the declaration has to finish for an event of checking whether the variable is set or not, so delete of the variable inside the variable declaration shouldn't work How to, with a timeout?
delete myarray[key]? Your problem isn't clear. Can you post more code so that we don't have to shoot in the dark (many possible problems here) ?