Skip to content

Instantly share code, notes, and snippets.

@pbojinov
Created July 22, 2013 02:34
Simple CORS (XHR) example. Note IE8< uses XDomainRequest
var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://corstest.pbojinov.c9.io/?feed=rss2');
xhr.onreadystatechange = function () {
if (this.status == 200 && this.readyState == 4) {
console.log('response: ' + this.responseText);
}
};
xhr.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment