Skip to content

Commit 0d620c3

Browse files
committed
Write a JavaScript script that fetches and lists the title for all movies by using this URL: https://swapi-api.alx-tools.com/api/films/?format=json
1 parent 0d9dd08 commit 0d620c3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
$(document).ready(function () {
2+
$.getJSON(
3+
"https://swapi-api.alx-tools.com/api/films/?format=json",
4+
function (data) {
5+
data.results.forEach(function (film) {
6+
$("<li>").text(film.title).appendTo("ul#list_movies");
7+
});
8+
}
9+
);
10+
});

0 commit comments

Comments
 (0)