Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created January 25, 2013 19:54
Show Gist options
  • Save tmcw/4637321 to your computer and use it in GitHub Desktop.
Save tmcw/4637321 to your computer and use it in GitHub Desktop.
CORS
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 20px sans-serif;
}
h1 {
color:red;
}
h1.success {
color:green;
}
</style>
<body>
<h1>FAILURE</h1>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
d3.json("http://a.tiles.mapbox.com/v3/openstreetmap.map-hn253zqn/geocode/chester%2C%20nj.json",
function(error, data) {
if (!error) {
d3.selectAll('h1').text('success').attr('class', 'success');
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment