Created
December 9, 2011 20:05
-
-
Save jonathanmeaney/1453069 to your computer and use it in GitHub Desktop.
Using google books rest api to search for books
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function view_books() | |
{ | |
$.getJSON('https://www.googleapis.com/books/v1/volumes?q=food+allergies&maxResults=5', function(data) { | |
var items = []; | |
$.each(data, function(key, val) { | |
items.push('<li id="' + key + '">' + val + '</li>'); | |
}); | |
$('<ul/>', { | |
'class': 'my-new-list', | |
html: items.join('') | |
}).appendTo('body'); | |
}); | |
} | |
function view_books2() | |
{ | |
$.ajax({ | |
url: "https://www.googleapis.com/books/v1/volumes?q=food+allergies&maxResults=5", | |
dataType: "json", | |
success: function(){ | |
} | |
}); | |
} | |
</script> | |
<button onclick="view_books();">Click</button> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment