Skip to content

Instantly share code, notes, and snippets.

@also
Created September 4, 2010 19:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save also/565446 to your computer and use it in GitHub Desktop.
Save also/565446 to your computer and use it in GitHub Desktop.
<!-- make a synchronous cross-domain request to The Echo Nest API -->
<!DOCTYPE html>
<html>
<head>
<title>Echo Nest API Cross-Domain Example</title>
</head>
<body>
<h1>Echo Nest API Cross-Domain Example</h1>
<p><strong>Results:</strong></p>
<p><code id="results"></code></p>
<script type="text/javascript">
var url = "http://london.developer.sandpit.us/api/v4/artist/images?api_key=N6E4NIOVYMTHNDM8J&id=ARH6W4X1187B99274F";
var req = new XMLHttpRequest();
req.open('GET', url, false);
try {
req.send(null);
}
catch (e) {
document.getElementById('results').innerHTML += e;
}
if(req.status == 200) {
document.getElementById('results').innerHTML += req.responseText;
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment