CodePen

HTML

            
              
            
          
!
via HTML Inspector

CSS

            
              
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              var url = “http://api.usatoday.com/open/articles/topnews/home?count=10&days=0&page=0&encoding=json&api_key=YOUR_API_KEY”;
var xhr = new XMLHttpRequest;
xhr.open("GET", url, true);
//Run this every time the connection state changes
xhr.onreadystatechange = function() { 
  if (xhr.readyState == 4) {  //Request is complete
    if(xhr.state == 200) {  //Response is ready
      alert("Request succeeded. Data:  "+xhr.responseText);
    } else { //Error handler
      alert(“Request failed with error code: ” + xhr.state); 
    }
  }
}
xhr.send(null);

            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................