Skip to content

Instantly share code, notes, and snippets.

@mayosuke
Forked from mbostock/.block
Last active March 13, 2016 02:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayosuke/151f8c7cf195a72a71ef to your computer and use it in GitHub Desktop.
Save mayosuke/151f8c7cf195a72a71ef to your computer and use it in GitHub Desktop.
test.
http://bl.ocks.org/mayosuke/151f8c7cf195a72a71ef
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
</head>
<body>
<script type="text/javascript" language="javascript">
<!--
var xhr= new XMLHttpRequest();
xhr.open("GET","http://data.sparkfun.com/output/8dDDd7D9AWF82d8wG2dQ.json");
xhr.responseType = 'json';
xhr.onload=function(ev){
if (xhr.readyState === 4) {
if (xhr.status === 200) {
//console.log(xhr.responseText);
document.open();
document.write(xhr.response[0]['masu']);
document.close();
} else {
console.error(xhr.statusText);
}
}
};
xhr.send();
// -->
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment