123456789101112131415161718192021222324252627 |
- var request = new XMLHttpRequest();
-
- request.open('GET', 'https://data.sfgov.org/api/views/yitu-d5am/rows.json?accessType=DOWNLOAD');
-
- request.onreadystatechange = function() {
- if((request.status === 200) && (request.readyState === 4)){
- console.log(request.responseText)
- var list = JSON.parse(this.responseText);
- let movies = list.data;
-
- var newMovies = "";
-
- for(let i= 0; i< movies.length; i++){
- if(movies[i].includes("Golden Gate Bridge")){
- newMovies+= "Title: " + movies[i][8] + '<br>';
- newMovies+= "Year: " + movies[i][9] + '<br>';
- newMovies+= "Production Company: " + movies[i][12] + '<br>';
- }
-
- }
-
- document.getElementById('result').innerHTML += newMovies;
- }
-
- }
- request.send();
|