The site contains movies data.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

51 lines
1.5 KiB

<html>
<head>
<title>
Search Movies
</title>
<!--<link rel="stylesheet" href="searchstyle.css">-->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="movies.js"></script>
</head>
<body>
<div class="header">
<div id="Container"></div>
</div>
<script>
window.addEventListener("load", moviePage);
async function moviePage(e){
var Token=window.localStorage.getItem('Token');
const searchParams = new URLSearchParams(window.location.search);
const movieId = searchParams.get("movieId");
try {
const response = await fetch('https://mkr.thefeathers.in/movie/'+movieId, {
method: 'GET',
headers: new Headers({'Authentication': Token }),
});
const data3 = await response.json();
//Success code goes here
alert(JSON.stringify(data3));
var results1 =data3.data;
var img=document.createElement("img");
img.src=results1.poster;
document.body.appendChild(img);
var text = [results1.movieId, results1.title, results1.overview,results1.release,results1.watchStatus,results1.rating];
for(var i = 0; i < text.length; i += 1) {
var div = document.createElement("div");
div.className = "finalBlock";
div.innerHTML = text[i];
document.body.appendChild(div);
}
}
catch (err) {
//Failure
alert('Error');
}
}
</script>
</body>