MCPcopy Create free account
hub / github.com/Yaffle/EventSource / onReadyStateChange

Function onReadyStateChange

tests/eventsource.js:329–344  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

327 }
328 };
329 var onReadyStateChange = function (event) {
330 if (xhr != undefined) { // Opera 12
331 if (xhr.readyState === 4) {
332 if (!("onload" in xhr) || !("onerror" in xhr) || !("onabort" in xhr)) {
333 onFinish(xhr.responseText === "" ? "error" : "load", event);
334 }
335 } else if (xhr.readyState === 3) {
336 if (!("onprogress" in xhr)) { // testing XMLHttpRequest#responseText too many times is too slow in IE 11
337 // and in Firefox 3.6
338 onProgress();
339 }
340 } else if (xhr.readyState === 2) {
341 onStart();
342 }
343 }
344 };
345 var onTimeout = function () {
346 timeout = setTimeout(function () {
347 onTimeout();

Callers 1

eventsource.jsFile · 0.70

Calls 3

onFinishFunction · 0.70
onProgressFunction · 0.70
onStartFunction · 0.70

Tested by

no test coverage detected