Skip to content

Instantly share code, notes, and snippets.

@KitaitiMakoto
Last active September 15, 2015 04:17
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 KitaitiMakoto/7dfb8f52da7d4e5fe8ca to your computer and use it in GitHub Desktop.
Save KitaitiMakoto/7dfb8f52da7d4e5fe8ca to your computer and use it in GitHub Desktop.
<!doctype html>
<style>
.keyword {
font-weight: bold;
color: red;
}
</style>
<h1></h1>
<div></div>
<script>
var req = new XMLHttpRequest();
req.responseType = "json";
req.onload = function() {
var data = this.response;
console.dir(data);
document.querySelector("h1").textContent = "Title: " + data[1][0][2][0];
document.querySelector("div").innerHTML = data[1][0][2][1];
}
req.open("get", "http://epub-searcher-demo.kitaitimakoto.net/d/select?table=Books&query=CSS&match_columns=author,title,main_text&output_columns=title,snippet_html(main_text)");
req.send();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment