-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
39 lines (26 loc) · 914 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function abc(){
var search=$("#b").val();
var x = document.getElementById("section_result");
x.style.display="block";
if(search=='')
{
alert("Please enter something");
}
else{
var url='';
var img='';
var title='';
var author='';
var url1='';
$.get("https://www.googleapis.com/books/v1/volumes?q="+search,function(response){
for(i=0;i<response.items.length;i++)
{
title=$('<h5>'+response.items[i].volumeInfo.title+'</h5>');
img=$('<img id="dynamic"><br><a href='+response.items[i].volumeInfo.infoLink+'><button id="imagebutton">Read More</button></a>');
url=response.items[i].volumeInfo.imageLinks.thumbnail;
url1=$('<h5>'+response.items[i].volumeInfo.imageLinks.thumbnail+'</h5>');
img.attr('src',url);
title.appendTo("#result");
img.appendTo("#result");
url1.appendTo("#result");
}