-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
82 lines (77 loc) · 2.87 KB
/
index.html
File metadata and controls
82 lines (77 loc) · 2.87 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Filmy Adda</title>
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.15.3/css/all.css"
integrity="sha384-SZXxX4whJ79/gErwcOYf+zWLeJdY/qpuqC4cAa9rOGUstPomtqpuNWT9wdPEn2fk"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="bootstrap.css" type="text/css" />
</head>
<body>
<div class="container">
<h1 class="text-center mt-2" style="margin-bottom: 2px; font-weight: 900">
Filmy Adda
</h1>
<h6 class="text-center pt-0" style="font-weight: 700">
naam toh suna hi hoga....
</h6>
<form id="moviesearch" autocomplete="off" class="mt-4">
<div class="form-group">
<input
class="form-control text-center"
type="text"
id="movieName"
style="font-weight: bold;"
placeholder="Search for your Favourite Movie..."
/>
</div>
<div class="form-group">
<button
style="display: block; width: 100%; font-weight: bold"
class="btn btn-dark mt-1 mx-auto"
>
Search Movie <i class="fas fa-search"></i>
</button>
</div>
</form>
<div id="displayresult" class="mt-2">
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
$("#moviesearch").submit(function (event) {
var apikey = "1e7a31b6";
event.preventDefault();
var moviename = $("#movieName").val();
var result = "";
var url =
"https://www.omdbapi.com/?apikey=" + apikey + "&t=" + moviename;
$.ajax({
method: "GET",
url: url,
success: function (data) {
console.log(data);
result = `
<img id="movieimg" style="float:right; margin-right:50px; margin-bottom:20px;" class="img-thumnail" width="300" height="300" src="${data.Poster}" />
<h1 class="mb-1 mr-5">${"Title:-"+data.Title}</h1>
<h3 class="mb-1 mr-5">${"Rating:-"+data.imdbRating}</h3>
<h3 class="mb-1 mr-5">${"Genre:-"+data.Genre}</h3>
<h3 class="mb-1 mr-5">${"Language:-"+data.Language}</h3>
<h3 class="mb-1 mr-5">${"Released:-"+data.Released}</h3>
<h3 class="mb-1 mr-5">${"Director:-"+data.Director}</h3>
<h3 class="mb-1 mr-5">${"Actors:-"+data.Actors}</h3>
`;
$("#displayresult").html(result);
},
});
});
});
</script>
</body>
</html>