12345678910111213141516 |
- var xhr = new XMLHttpRequest();
- xhr.open('GET','https://data.sfgov.org/api/views/yitu-d5am/rows.json?accessType=DOWNLOAD');
- xhr.onreadystatechange = function(){
- if((xhr.status===200) && (xhr.readyState===4)){
- let movieData = JSON.parse(xhr.responseText);
- let movies = movieData.data;
- for(let i = 0; i < movies.length; i++){
- let currentMovie = movies[i];
- if(currentMovie[10]=='Golden Gate Bridge'){
- document.getElementById('result').innerHTML += currentMovie[8] +
- ' - ' + currentMovie[9] + ' - ' + currentMovie[12] + '<br>';
- }
- }
- }
- }
- xhr.send();
|