pbojinov
7/22/2013 - 2:34 AM

Simple CORS (XHR) example. Note IE8< uses XDomainRequest

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();