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