Selaa lähdekoodia

completed lab

Christian Sheridan 6 vuotta sitten
vanhempi
commit
3bd8388045
7 muutettua tiedostoa jossa 197 lisäystä ja 1 poistoa
  1. 9
    0
      .idea/JSON-Lab-2.iml
  2. 6
    0
      .idea/misc.xml
  3. 8
    0
      .idea/modules.xml
  4. 6
    0
      .idea/vcs.xml
  5. 139
    0
      .idea/workspace.xml
  6. 2
    1
      index.html
  7. 27
    0
      myfile.js

+ 9
- 0
.idea/JSON-Lab-2.iml Näytä tiedosto

@@ -0,0 +1,9 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module type="JAVA_MODULE" version="4">
3
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+    <exclude-output />
5
+    <content url="file://$MODULE_DIR$" />
6
+    <orderEntry type="inheritedJdk" />
7
+    <orderEntry type="sourceFolder" forTests="false" />
8
+  </component>
9
+</module>

+ 6
- 0
.idea/misc.xml Näytä tiedosto

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="JavaScriptSettings">
4
+    <option name="languageLevel" value="ES6" />
5
+  </component>
6
+</project>

+ 8
- 0
.idea/modules.xml Näytä tiedosto

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectModuleManager">
4
+    <modules>
5
+      <module fileurl="file://$PROJECT_DIR$/.idea/JSON-Lab-2.iml" filepath="$PROJECT_DIR$/.idea/JSON-Lab-2.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 6
- 0
.idea/vcs.xml Näytä tiedosto

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="" vcs="Git" />
5
+  </component>
6
+</project>

+ 139
- 0
.idea/workspace.xml Näytä tiedosto

@@ -0,0 +1,139 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="948c61f9-2033-4f26-b142-17aaad6a197b" name="Default Changelist" comment="">
5
+      <change beforePath="$PROJECT_DIR$/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/index.html" afterDir="false" />
6
+    </list>
7
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
8
+    <option name="SHOW_DIALOG" value="false" />
9
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
10
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
11
+    <option name="LAST_RESOLUTION" value="IGNORE" />
12
+  </component>
13
+  <component name="FUSProjectUsageTrigger">
14
+    <session id="575680249">
15
+      <usages-collector id="statistics.lifecycle.project">
16
+        <counts>
17
+          <entry key="project.closed" value="1" />
18
+          <entry key="project.open.time.1" value="1" />
19
+          <entry key="project.opened" value="1" />
20
+        </counts>
21
+      </usages-collector>
22
+    </session>
23
+  </component>
24
+  <component name="Git.Settings">
25
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
26
+  </component>
27
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
28
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
29
+  <component name="JsGulpfileManager">
30
+    <detection-done>true</detection-done>
31
+    <sorting>DEFINITION_ORDER</sorting>
32
+  </component>
33
+  <component name="ProjectFrameBounds">
34
+    <option name="x" value="20" />
35
+    <option name="y" value="-1051" />
36
+    <option name="width" value="1868" />
37
+    <option name="height" value="1051" />
38
+  </component>
39
+  <component name="ProjectView">
40
+    <navigator proportions="" version="1">
41
+      <foldersAlwaysOnTop value="true" />
42
+    </navigator>
43
+    <panes>
44
+      <pane id="ProjectPane">
45
+        <subPane>
46
+          <expand>
47
+            <path>
48
+              <item name="JSON-Lab-2" type="b2602c69:ProjectViewProjectNode" />
49
+              <item name="JSON-Lab-2" type="462c0819:PsiDirectoryNode" />
50
+            </path>
51
+            <path>
52
+              <item name="JSON-Lab-2" type="b2602c69:ProjectViewProjectNode" />
53
+              <item name="JSON-Lab-2" type="462c0819:PsiDirectoryNode" />
54
+              <item name=".idea" type="462c0819:PsiDirectoryNode" />
55
+            </path>
56
+          </expand>
57
+          <select />
58
+        </subPane>
59
+      </pane>
60
+      <pane id="PackagesPane" />
61
+      <pane id="Scope" />
62
+    </panes>
63
+  </component>
64
+  <component name="PropertiesComponent">
65
+    <property name="WebServerToolWindowFactoryState" value="false" />
66
+    <property name="aspect.path.notification.shown" value="true" />
67
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
68
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
69
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
70
+    <property name="settings.editor.selected.configurable" value="project.propCompiler" />
71
+  </component>
72
+  <component name="RunDashboard">
73
+    <option name="ruleStates">
74
+      <list>
75
+        <RuleState>
76
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
77
+        </RuleState>
78
+        <RuleState>
79
+          <option name="name" value="StatusDashboardGroupingRule" />
80
+        </RuleState>
81
+      </list>
82
+    </option>
83
+  </component>
84
+  <component name="SvnConfiguration">
85
+    <configuration />
86
+  </component>
87
+  <component name="TaskManager">
88
+    <task active="true" id="Default" summary="Default task">
89
+      <changelist id="948c61f9-2033-4f26-b142-17aaad6a197b" name="Default Changelist" comment="" />
90
+      <created>1544646644395</created>
91
+      <option name="number" value="Default" />
92
+      <option name="presentableId" value="Default" />
93
+      <updated>1544646644395</updated>
94
+      <workItem from="1544646646294" duration="11000" />
95
+    </task>
96
+    <servers />
97
+  </component>
98
+  <component name="TimeTrackingManager">
99
+    <option name="totallyTimeSpent" value="11000" />
100
+  </component>
101
+  <component name="ToolWindowManager">
102
+    <frame x="20" y="-1051" width="1868" height="1051" extended-state="0" />
103
+    <layout>
104
+      <window_info id="Image Layers" />
105
+      <window_info id="Designer" />
106
+      <window_info id="UI Designer" />
107
+      <window_info id="Capture Tool" />
108
+      <window_info id="Favorites" side_tool="true" />
109
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24972618" />
110
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
111
+      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
112
+      <window_info anchor="bottom" id="Version Control" />
113
+      <window_info anchor="bottom" id="Terminal" />
114
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
115
+      <window_info anchor="bottom" id="Message" order="0" />
116
+      <window_info anchor="bottom" id="Find" order="1" />
117
+      <window_info anchor="bottom" id="Run" order="2" />
118
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
119
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
120
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
121
+      <window_info anchor="bottom" id="TODO" order="6" />
122
+      <window_info anchor="right" id="Palette" />
123
+      <window_info anchor="right" id="Theme Preview" />
124
+      <window_info anchor="right" id="Capture Analysis" />
125
+      <window_info anchor="right" id="Palette&#9;" />
126
+      <window_info anchor="right" id="Database" />
127
+      <window_info anchor="right" id="Maven Projects" />
128
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
129
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
130
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
131
+    </layout>
132
+  </component>
133
+  <component name="TypeScriptGeneratedFilesManager">
134
+    <option name="version" value="1" />
135
+  </component>
136
+  <component name="VcsContentAnnotationSettings">
137
+    <option name="myLimit" value="2678400000" />
138
+  </component>
139
+</project>

+ 2
- 1
index.html Näytä tiedosto

@@ -3,6 +3,7 @@
3 3
 <head>
4 4
     <meta charset="UTF-8">
5 5
     <link href="./css/style.css" type="text/css" rel="stylesheet">
6
+    <script type = "text/javascript" src="myfile.js"></script>
6 7
     <title>Import Local JSON Data | Zipcode Wilmington</title>
7 8
 </head>
8 9
 <body>
@@ -39,4 +40,4 @@
39 40
     	<div id="result"></div>
40 41
     </section>
41 42
 </body>
42
-</html>
43
+</html>

+ 27
- 0
myfile.js Näytä tiedosto

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