Ok hi. Im having a lot of problems with a project im building. I want to use Ajax to make a request to the Google.Books api so i can make book searches from my website. Its a Asp.net MVC project. Im using Ajax on one of the pages. The documentation says just send a GET request to the url. I wrote the ajax request and I seem to get an 200 ok response but im not getting the json object. Also i want to put the info from the json response to show the title of the book and the author. Possibly a dropdown in html or a select div in html.
$(document).ready(function () {
$('getBookList').submit(function () {
var key = "AIzaSyAAD3qgVCx8MeoD6aD-CzTasKijPE-Ny3Y";
$.ajax({
type: "GET",
url: "https://www.googleapis.com/books/v1/volumes?q=search+terms&" + key,
dataType: 'jsonp',
data: { volumeInfo: title, volumeInfo: authors },
success: function (data) {
$('#volumeInfo:title').dropdown("show")(data)
$('#volumeInfo:authors').dropdown("show")(data)
$('#q').dropdown("show")(data)
.fail(function (xhr, status, errorThrown) {
alert("Sorry, there was a problem!");
console.log("Error: " + errorThrown);
console.log("Status: " + status);
console.dir(xhr);
});
}
});
});
});