Código PHP:
{
peliculas: [
{
id: "185",
off_line: "0",
id_themoviedb: "536506",
poster_path: "/1rmq9fqm01W3pMBvbLH2DsKU44c.jpg",
titulo: "Buenos principios",
genero: "Comedia",
anyo: "2.019",
url: "https://mystream.to/...",
reproductor: "web",
fecha: "2020-08-29 15:50:22"
},
{
id: "213",
off_line: "1",
continua...
Código PHP:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Mis peliculas</title>
<link href="https://fonts.googleapis.com/css?family=Faster+One" rel="stylesheet">
</head>
<body>
<script>
let requestURL = 'http://miurl';
let request = new XMLHttpRequest();
request.open('GET', requestURL);
request.responseType = 'json';
request.send();
request.onload = function() {
const peliculas = request.response;
showPelis(peliculas);
}
function showPelis(jsonObj) {
const pelis = jsonObj['peliculas'];
for(let i = 0; i < pelis.length; i++) {
const myArticle = document.createElement('article');
document.write(pelis[i].titulo + ' ');
}
}
</script>
</body>
</html>