|
@ -27,16 +27,19 @@ try { |
|
|
const data3 = await response.json(); |
|
|
const data3 = await response.json(); |
|
|
//Success code goes here |
|
|
//Success code goes here |
|
|
alert(JSON.stringify(data3)); |
|
|
alert(JSON.stringify(data3)); |
|
|
var results1 =data3.results; |
|
|
var results1 =data3.data; |
|
|
|
|
|
|
|
|
document.getElementById("Container").append(results1.movieId); |
|
|
var img=document.createElement("img"); |
|
|
document.getElementById("Container").append(results1.title); |
|
|
img.src=results1.poster; |
|
|
document.getElementById("Container").append(results1.overview); |
|
|
document.body.appendChild(img); |
|
|
document.getElementById("Container").append(results1.poster); |
|
|
|
|
|
document.getElementById("Container").append(results1.release); |
|
|
|
|
|
document.getElementById("Container").append(results1.watchStatus); |
|
|
|
|
|
document.getElementById("Container").append(results1.rating); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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) { |
|
|
catch (err) { |
|
|