Fixed getLastModified callback firing three times #130

Merged
pmcelhaney merged 1 commits from patch-1 into master 2012-03-19 19:11:28 +00:00
Showing only changes of commit af20af8524 - Show all commits

View File

@ -44,9 +44,11 @@
http.open('HEAD', location, true);
http.onreadystatechange = function() {
console.log(http);
console.log(http.getResponseHeader('Last-Modified'));
callback(http.getResponseHeader('Last-Modified'));
if(http.readyState === http.DONE) {
console.log(http);
console.log(http.getResponseHeader('Last-Modified'));
callback(http.getResponseHeader('Last-Modified'));
}
};
http.send();
}