Merge pull request #130 from pmcelhaney/patch-1

Fixed getLastModified callback firing three times
This commit is contained in:
John Bintz 2012-03-19 12:11:28 -07:00
commit d572b0d6fe

View File

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