Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
// Get Programming with JavaScript
// Listing 20.01
// Using an XHR object to load user data
var xhr = new XMLHttpRequest();
var url = "http://output.jsbin.com/qiwizo.json";
xhr.addEventListener("load", function () {
  console.log(xhr.responseText);
});
xhr.open("GET", url);
xhr.send();
/* Further Adventures
 *
 * 1) Run the program to see the data load.
 *
 * 2) Change the URL to pobapa.json
 *    instead of qiwizo.json and
 *    run the program again.
 *
 */
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
jrlarsenpro
0viewers