Skip to content

Instantly share code, notes, and snippets.

@DylanPiercey
Last active September 19, 2016 00:39
Show Gist options
  • Save DylanPiercey/d283953be55dc0d4c20b0d08ea4430f2 to your computer and use it in GitHub Desktop.
Save DylanPiercey/d283953be55dc0d4c20b0d08ea4430f2 to your computer and use it in GitHub Desktop.
const xhr = new XMLHttpRequest();
xhr.onload = () => {
// Consume response body.
const body = xhr.responseText;
}
xhr.onerror = (e) => {
console.log(`Got error: ${e.message}`);
}
oReq.open("GET", 'http://www.google.com/index.html');
oReq.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment