Skip to content

Instantly share code, notes, and snippets.

@bdunnette
Last active May 24, 2018 13:36
Show Gist options
  • Save bdunnette/9649323 to your computer and use it in GitHub Desktop.
Save bdunnette/9649323 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Google Fusion Tables API Example</title>
</head>
<body>
<div id="content"></div>
<script>
function handler(response) {
for (var i = 0; i < response.items.length; i++) {
var item = response.items[i];
// Either show the body or the automatic columns of the template
if (item.body) {
document.getElementById("content").innerHTML += "<br>" + item.body;
} else {
for (var j = 0; j < item.automaticColumnNames.length; j++) {
document.getElementById("content").innerHTML += "<br>" + item.automaticColumnNames[j];
}
}
}
}
</script>
<script src="https://www.googleapis.com/fusiontables/v1/tables/1kdgpnZSQe3mPOXRXApL0np_PTCHGO1UIDanQ5ZQe/templates?callback=handler&key=AIzaSyBS3nzHjd_ghBBVaCRnSy9pulBM0xkTRI4"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment