Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created November 29, 2011 20:44
Show Gist options
  • Select an option

  • Save Raynos/1406426 to your computer and use it in GitHub Desktop.

Select an option

Save Raynos/1406426 to your computer and use it in GitHub Desktop.
JSON by XHR
var xhr = new XMLHttpRequest;
xhr.addEventListener("load", function () {
var result = this.responseText;
});
xhr.open("GET", "url");
xhr.overrideMimeType("application/json");
xhr.send(JSON.stringify(data));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment