|
@@ -0,0 +1,26 @@
|
|
1
|
+var request = new XMLHttpRequest();
|
|
2
|
+
|
|
3
|
+request.open('GET', 'https://data.sfgov.org/api/views/yitu-d5am/rows.json?accessType=DOWNLOAD');
|
|
4
|
+
|
|
5
|
+request.onreadystatechange = function() {
|
|
6
|
+ if((request.status === 200) && (request.readyState === 4)){
|
|
7
|
+ console.log(request.responseText)
|
|
8
|
+ var list = JSON.parse(this.responseText);
|
|
9
|
+ let movies = list.data;
|
|
10
|
+
|
|
11
|
+ var newMovies = "";
|
|
12
|
+
|
|
13
|
+ for(let i= 0; i< movies.length; i++){
|
|
14
|
+ if(movies[i].includes("Golden Gate Bridge")){
|
|
15
|
+ newMovies+= "Title: " + movies[i][8] + '<br>';
|
|
16
|
+ newMovies+= "Year: " + movies[i][9] + '<br>';
|
|
17
|
+ newMovies+= "Production Company: " + movies[i][12] + '<br>';
|
|
18
|
+ }
|
|
19
|
+
|
|
20
|
+ }
|
|
21
|
+
|
|
22
|
+ document.getElementById('result').innerHTML += newMovies;
|
|
23
|
+ }
|
|
24
|
+
|
|
25
|
+}
|
|
26
|
+request.send();
|