|
@@ -0,0 +1,20 @@
|
|
1
|
+let httpRequest = new XMLHttpRequest();
|
|
2
|
+
|
|
3
|
+httpRequest.open("GET", "https://data.sfgov.org/api/views/yitu-d5am/rows.json?accessType=DOWNLOAD", true);
|
|
4
|
+
|
|
5
|
+httpRequest.onreadystatechange = function () {
|
|
6
|
+
|
|
7
|
+ if ((httpRequest.readyState === 4) && (httpRequest.status === 200)) {
|
|
8
|
+
|
|
9
|
+ let jsonData = JSON.parse(httpRequest.responseText).data;
|
|
10
|
+
|
|
11
|
+ for (let i = 0; i < jsonData.length; i++) {
|
|
12
|
+ if (jsonData[i][10] === "Golden Gate Bridge") {
|
|
13
|
+ document.getElementById('result').innerHTML += (jsonData[i][8] + " (" + jsonData[i][9] + ")<br>Produced by "
|
|
14
|
+ + jsonData[i][12] + "<br><br>");
|
|
15
|
+ }
|
|
16
|
+ }
|
|
17
|
+ }
|
|
18
|
+};
|
|
19
|
+
|
|
20
|
+httpRequest.send();
|