×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Gabriel Matos
Added: Mar 11, 2014 2:13 PM
Modified: Mar 11, 2014 2:13 PM
Views: 1822
  1. var xhr = new XMLHttpRequest();
  2. xhr.onreadystatechange = function () {
  3.   if (this.readyState == 4) {
  4.     console.log(this.responseText);
  5.     console.dir(JSON.parse(this.responseText));
  6.   }
  7. };
  8.  
  9. function Get(url)
  10. {
  11.    xhr.open("GET",url, true);
  12.    xhr.send(null);
  13. }