Skip to content

Instantly share code, notes, and snippets.

@vaclavcadek
Created January 20, 2015 14:27
Show Gist options
  • Save vaclavcadek/3a5d886f2b8deffe54bb to your computer and use it in GitHub Desktop.
Save vaclavcadek/3a5d886f2b8deffe54bb to your computer and use it in GitHub Desktop.
Simple XMLHttpRequest
var xhr = new XMLHttpRequest();
xhr.open('GET', '/media/resources/gamedev/weapon.json', true);
xhr.onload = function() {
JSON.parse(this.responseText);
};
xhr.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment