Mypal/dom/xhr/tests/worker_xhr_cors_redirect.js

11 lines
225 B
JavaScript

onmessage = function(e) {
var xhr = new XMLHttpRequest();
xhr.open('GET', e.data, true);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
postMessage(xhr.status);
}
};
xhr.send();
};