While playing with XHR requests, I found an interesting thing in creating XHR requests from two main browsers - Google Chrome and Mozilla Firefox. The request was a simple HEADrequest www.google.ba:
var xhr = new XMLHttpRequest();
xhr.open('HEAD' , 'www.google.ba', true);
xhr.onreadystatechange = function (aEvt){
if (xhr.readyState == 4) {
if (xhr.status >= 200 && xhr.status < 304) {
console.log('Connected');
} else {
console.log('No net');
}
}
};
xhr.send();
After trying to make an XHR request, while there was no connection, I would get readyState 4 and status 0 in both browsers. After I reconnected, the XHR request from both browsers was successful.
, , , Chrome readyState 4 0 9 , Firefox - . 13 , . 0 Firefox 13 . -, Firefox?
Chrome:

Firefox:

EDIT:
, Firefox , work offline , , Chrome. , Chrome?