1
0
Fork 0

Check XHR state before aborting

This commit is contained in:
Gregory Eremin 2014-07-05 15:05:16 +07:00
parent 5f97af68c7
commit 53e8d361df
1 changed files with 7 additions and 2 deletions

View File

@ -51,8 +51,13 @@
log('The mouse is OUT!');
if (STORAGE[i].xhr !== undefined) {
STORAGE[i].xhr.abort();
log('XHR aborted!');
var state = STORAGE[i].xhr.readyState,
done = STORAGE[i].xhr.DONE;
if (state !== done) {
STORAGE[i].xhr.abort();
log('XHR aborted!');
}
}
window.clearTimeout(STORAGE[i].load_timeout);
window.clearTimeout(STORAGE[i].show_timeout);