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