#24 completed json2

Öppen
sambhutani vill sammanfoga 1 incheckningar från s[2]s in i master
7 ändrade filer med 479 tillägg och 0 borttagningar
  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. 368
    0
      .idea/workspace.xml
  6. 3
    0
      index.html
  7. 79
    0
      json2.js

+ 9
- 0
.idea/JSON-Lab-2.iml Visa fil

@@ -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 Visa fil

@@ -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 Visa fil

@@ -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 Visa fil

@@ -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>

+ 368
- 0
.idea/workspace.xml Visa fil

@@ -0,0 +1,368 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="e59e9177-a5b1-456f-bbb9-941c6d467c3e" name="Default Changelist" comment="">
5
+      <change afterPath="$PROJECT_DIR$/json2.js" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/index.html" afterDir="false" />
7
+    </list>
8
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
9
+    <option name="SHOW_DIALOG" value="false" />
10
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
11
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
12
+    <option name="LAST_RESOLUTION" value="IGNORE" />
13
+  </component>
14
+  <component name="FUSProjectUsageTrigger">
15
+    <session id="-1058291569">
16
+      <usages-collector id="statistics.lifecycle.project">
17
+        <counts>
18
+          <entry key="project.closed" value="3" />
19
+          <entry key="project.open.time.1" value="1" />
20
+          <entry key="project.open.time.4" value="2" />
21
+          <entry key="project.open.time.8" value="1" />
22
+          <entry key="project.opened" value="4" />
23
+        </counts>
24
+      </usages-collector>
25
+      <usages-collector id="statistics.file.extensions.open">
26
+        <counts>
27
+          <entry key="css" value="1" />
28
+          <entry key="gitignore" value="1" />
29
+          <entry key="html" value="2" />
30
+          <entry key="iml" value="2" />
31
+          <entry key="json" value="2" />
32
+          <entry key="json2" value="1" />
33
+          <entry key="md" value="2" />
34
+          <entry key="xml" value="8" />
35
+        </counts>
36
+      </usages-collector>
37
+      <usages-collector id="statistics.file.types.open">
38
+        <counts>
39
+          <entry key="CSS" value="1" />
40
+          <entry key="HTML" value="2" />
41
+          <entry key="IDEA_MODULE" value="2" />
42
+          <entry key="JavaScript" value="3" />
43
+          <entry key="Markdown" value="2" />
44
+          <entry key="PLAIN_TEXT" value="1" />
45
+          <entry key="XML" value="8" />
46
+        </counts>
47
+      </usages-collector>
48
+      <usages-collector id="statistics.file.extensions.edit">
49
+        <counts>
50
+          <entry key="html" value="129" />
51
+          <entry key="js" value="53" />
52
+          <entry key="json2" value="191" />
53
+        </counts>
54
+      </usages-collector>
55
+      <usages-collector id="statistics.file.types.edit">
56
+        <counts>
57
+          <entry key="HTML" value="129" />
58
+          <entry key="JavaScript" value="244" />
59
+        </counts>
60
+      </usages-collector>
61
+    </session>
62
+  </component>
63
+  <component name="FileEditorManager">
64
+    <splitter split-orientation="horizontal" split-proportion="0.62560153">
65
+      <split-first>
66
+        <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
67
+          <file pinned="false" current-in-tab="true">
68
+            <entry file="file://$PROJECT_DIR$/json2.js">
69
+              <provider selected="true" editor-type-id="text-editor">
70
+                <state relative-caret-position="279">
71
+                  <caret line="59" column="54" lean-forward="true" selection-start-line="59" selection-start-column="54" selection-end-line="59" selection-end-column="54" />
72
+                  <folding>
73
+                    <element signature="n#!!doc" expanded="true" />
74
+                  </folding>
75
+                </state>
76
+              </provider>
77
+            </entry>
78
+          </file>
79
+          <file pinned="false" current-in-tab="false">
80
+            <entry file="file://$PROJECT_DIR$/index.html">
81
+              <provider selected="true" editor-type-id="text-editor">
82
+                <state relative-caret-position="532">
83
+                  <caret line="39" column="36" lean-forward="true" selection-start-line="39" selection-end-line="40" />
84
+                </state>
85
+              </provider>
86
+            </entry>
87
+          </file>
88
+          <file pinned="false" current-in-tab="false">
89
+            <entry file="file://$PROJECT_DIR$/.idea/misc.xml">
90
+              <provider selected="true" editor-type-id="text-editor">
91
+                <state relative-caret-position="75">
92
+                  <caret line="5" column="9" selection-start-line="5" selection-start-column="9" selection-end-line="5" selection-end-column="9" />
93
+                </state>
94
+              </provider>
95
+            </entry>
96
+          </file>
97
+          <file pinned="false" current-in-tab="false">
98
+            <entry file="file://$PROJECT_DIR$/.idea/modules.xml">
99
+              <provider selected="true" editor-type-id="text-editor" />
100
+            </entry>
101
+          </file>
102
+          <file pinned="false" current-in-tab="false">
103
+            <entry file="file://$PROJECT_DIR$/.idea/vcs.xml">
104
+              <provider selected="true" editor-type-id="text-editor" />
105
+            </entry>
106
+          </file>
107
+          <file pinned="false" current-in-tab="false">
108
+            <entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
109
+              <provider selected="true" editor-type-id="text-editor">
110
+                <state relative-caret-position="-494" />
111
+              </provider>
112
+            </entry>
113
+          </file>
114
+          <file pinned="false" current-in-tab="false">
115
+            <entry file="file://$PROJECT_DIR$/css/style.css">
116
+              <provider selected="true" editor-type-id="text-editor">
117
+                <state relative-caret-position="-1163" />
118
+              </provider>
119
+            </entry>
120
+          </file>
121
+          <file pinned="false" current-in-tab="false">
122
+            <entry file="file://$PROJECT_DIR$/.idea/JSON-Lab-2.iml">
123
+              <provider selected="true" editor-type-id="text-editor">
124
+                <state relative-caret-position="120">
125
+                  <caret line="8" column="9" lean-forward="true" selection-start-line="8" selection-start-column="9" selection-end-line="8" selection-end-column="9" />
126
+                </state>
127
+              </provider>
128
+            </entry>
129
+          </file>
130
+        </leaf>
131
+      </split-first>
132
+      <split-second>
133
+        <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
134
+          <file pinned="false" current-in-tab="true">
135
+            <entry file="file://$PROJECT_DIR$/README.md">
136
+              <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
137
+                <state split_layout="SECOND">
138
+                  <first_editor />
139
+                  <second_editor />
140
+                </state>
141
+              </provider>
142
+            </entry>
143
+          </file>
144
+        </leaf>
145
+      </split-second>
146
+    </splitter>
147
+  </component>
148
+  <component name="Git.Settings">
149
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
150
+  </component>
151
+  <component name="IdeDocumentHistory">
152
+    <option name="CHANGED_PATHS">
153
+      <list>
154
+        <option value="$PROJECT_DIR$/.idea/json2" />
155
+        <option value="$PROJECT_DIR$/json2" />
156
+        <option value="$PROJECT_DIR$/index.html" />
157
+        <option value="$PROJECT_DIR$/json2.js" />
158
+      </list>
159
+    </option>
160
+  </component>
161
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
162
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
163
+  <component name="JsGulpfileManager">
164
+    <detection-done>true</detection-done>
165
+    <sorting>DEFINITION_ORDER</sorting>
166
+  </component>
167
+  <component name="ProjectFrameBounds">
168
+    <option name="y" value="23" />
169
+    <option name="width" value="1440" />
170
+    <option name="height" value="821" />
171
+  </component>
172
+  <component name="ProjectView">
173
+    <navigator proportions="" version="1">
174
+      <foldersAlwaysOnTop value="true" />
175
+    </navigator>
176
+    <panes>
177
+      <pane id="Scope" />
178
+      <pane id="PackagesPane" />
179
+      <pane id="ProjectPane">
180
+        <subPane>
181
+          <expand>
182
+            <path>
183
+              <item name="JSON-Lab-2" type="b2602c69:ProjectViewProjectNode" />
184
+              <item name="JSON-Lab-2" type="462c0819:PsiDirectoryNode" />
185
+            </path>
186
+          </expand>
187
+          <select />
188
+        </subPane>
189
+      </pane>
190
+    </panes>
191
+  </component>
192
+  <component name="PropertiesComponent">
193
+    <property name="WebServerToolWindowFactoryState" value="false" />
194
+    <property name="aspect.path.notification.shown" value="true" />
195
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1543769072986" />
196
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
197
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
198
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
199
+    <property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
200
+  </component>
201
+  <component name="RecentsManager">
202
+    <key name="MoveFile.RECENT_KEYS">
203
+      <recent name="$PROJECT_DIR$" />
204
+      <recent name="$PROJECT_DIR$/src" />
205
+    </key>
206
+  </component>
207
+  <component name="RunDashboard">
208
+    <option name="ruleStates">
209
+      <list>
210
+        <RuleState>
211
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
212
+        </RuleState>
213
+        <RuleState>
214
+          <option name="name" value="StatusDashboardGroupingRule" />
215
+        </RuleState>
216
+      </list>
217
+    </option>
218
+  </component>
219
+  <component name="RunManager">
220
+    <configuration name="index.html" type="JavascriptDebugType" factoryName="JavaScript Debug" temporary="true" nameIsGenerated="true" uri="http://localhost:63342/JSON-Lab-2/index.html">
221
+      <method v="2" />
222
+    </configuration>
223
+    <recent_temporary>
224
+      <list>
225
+        <item itemvalue="JavaScript Debug.index.html" />
226
+      </list>
227
+    </recent_temporary>
228
+  </component>
229
+  <component name="SvnConfiguration">
230
+    <configuration />
231
+  </component>
232
+  <component name="TaskManager">
233
+    <task active="true" id="Default" summary="Default task">
234
+      <changelist id="e59e9177-a5b1-456f-bbb9-941c6d467c3e" name="Default Changelist" comment="" />
235
+      <created>1543438713055</created>
236
+      <option name="number" value="Default" />
237
+      <option name="presentableId" value="Default" />
238
+      <updated>1543438713055</updated>
239
+      <workItem from="1543438716048" duration="431000" />
240
+      <workItem from="1543537937701" duration="680000" />
241
+      <workItem from="1543698644019" duration="1545000" />
242
+      <workItem from="1543763968911" duration="5026000" />
243
+    </task>
244
+    <servers />
245
+  </component>
246
+  <component name="TimeTrackingManager">
247
+    <option name="totallyTimeSpent" value="7682000" />
248
+  </component>
249
+  <component name="ToolWindowManager">
250
+    <frame x="0" y="23" width="1440" height="821" extended-state="0" />
251
+    <editor active="true" />
252
+    <layout>
253
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.15522175" />
254
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
255
+      <window_info id="Image Layers" order="2" />
256
+      <window_info id="Designer" order="3" />
257
+      <window_info id="UI Designer" order="4" />
258
+      <window_info id="Capture Tool" order="5" />
259
+      <window_info id="Favorites" order="6" side_tool="true" />
260
+      <window_info anchor="bottom" id="Message" order="0" />
261
+      <window_info anchor="bottom" id="Find" order="1" weight="0.32921812" />
262
+      <window_info anchor="bottom" id="Run" order="2" />
263
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
264
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
265
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
266
+      <window_info anchor="bottom" id="TODO" order="6" />
267
+      <window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
268
+      <window_info anchor="bottom" id="Terminal" order="8" />
269
+      <window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
270
+      <window_info anchor="bottom" id="Version Control" order="10" />
271
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
272
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
273
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
274
+      <window_info anchor="right" id="Palette" order="3" />
275
+      <window_info anchor="right" id="Capture Analysis" order="4" />
276
+      <window_info anchor="right" id="Theme Preview" order="5" />
277
+      <window_info anchor="right" id="Palette&#9;" order="6" />
278
+      <window_info anchor="right" id="SciView" order="7" />
279
+      <window_info anchor="right" id="Database" order="8" />
280
+      <window_info anchor="right" id="Maven Projects" order="9" />
281
+    </layout>
282
+  </component>
283
+  <component name="TypeScriptGeneratedFilesManager">
284
+    <option name="version" value="1" />
285
+  </component>
286
+  <component name="VcsContentAnnotationSettings">
287
+    <option name="myLimit" value="2678400000" />
288
+  </component>
289
+  <component name="editorHistoryManager">
290
+    <entry file="file://$PROJECT_DIR$/.gitignore">
291
+      <provider selected="true" editor-type-id="text-editor" />
292
+    </entry>
293
+    <entry file="file://$PROJECT_DIR$/.idea/json">
294
+      <provider selected="true" editor-type-id="text-editor" />
295
+    </entry>
296
+    <entry file="file://$PROJECT_DIR$/.idea/misc.xml">
297
+      <provider selected="true" editor-type-id="text-editor">
298
+        <state relative-caret-position="75">
299
+          <caret line="5" column="9" selection-start-line="5" selection-start-column="9" selection-end-line="5" selection-end-column="9" />
300
+        </state>
301
+      </provider>
302
+    </entry>
303
+    <entry file="file://$PROJECT_DIR$/.idea/modules.xml">
304
+      <provider selected="true" editor-type-id="text-editor" />
305
+    </entry>
306
+    <entry file="file://$PROJECT_DIR$/.idea/vcs.xml">
307
+      <provider selected="true" editor-type-id="text-editor" />
308
+    </entry>
309
+    <entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
310
+      <provider selected="true" editor-type-id="text-editor">
311
+        <state relative-caret-position="-494" />
312
+      </provider>
313
+    </entry>
314
+    <entry file="file://$PROJECT_DIR$/css/style.css">
315
+      <provider selected="true" editor-type-id="text-editor">
316
+        <state relative-caret-position="-1163" />
317
+      </provider>
318
+    </entry>
319
+    <entry file="file://$PROJECT_DIR$/.idea/JSON-Lab-2.iml">
320
+      <provider selected="true" editor-type-id="text-editor">
321
+        <state relative-caret-position="120">
322
+          <caret line="8" column="9" lean-forward="true" selection-start-line="8" selection-start-column="9" selection-end-line="8" selection-end-column="9" />
323
+        </state>
324
+      </provider>
325
+    </entry>
326
+    <entry file="file://$PROJECT_DIR$/README.md">
327
+      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
328
+        <state split_layout="SECOND">
329
+          <first_editor />
330
+          <second_editor />
331
+        </state>
332
+      </provider>
333
+    </entry>
334
+    <entry file="file://$PROJECT_DIR$/index.html">
335
+      <provider selected="true" editor-type-id="text-editor">
336
+        <state relative-caret-position="532">
337
+          <caret line="39" column="36" lean-forward="true" selection-start-line="39" selection-end-line="40" />
338
+        </state>
339
+      </provider>
340
+    </entry>
341
+    <entry file="file://$PROJECT_DIR$/json2.js">
342
+      <provider selected="true" editor-type-id="text-editor">
343
+        <state relative-caret-position="279">
344
+          <caret line="59" column="54" lean-forward="true" selection-start-line="59" selection-start-column="54" selection-end-line="59" selection-end-column="54" />
345
+          <folding>
346
+            <element signature="n#!!doc" expanded="true" />
347
+          </folding>
348
+        </state>
349
+      </provider>
350
+    </entry>
351
+  </component>
352
+  <component name="masterDetails">
353
+    <states>
354
+      <state key="ProjectJDKs.UI">
355
+        <settings>
356
+          <last-edited>1.8</last-edited>
357
+          <splitter-proportions>
358
+            <option name="proportions">
359
+              <list>
360
+                <option value="0.2" />
361
+              </list>
362
+            </option>
363
+          </splitter-proportions>
364
+        </settings>
365
+      </state>
366
+    </states>
367
+  </component>
368
+</project>

+ 3
- 0
index.html Visa fil

@@ -37,6 +37,9 @@
37 37
     <section>
38 38
     	<h1>Movie Information</h1>
39 39
     	<div id="result"></div>
40
+        <script type= text/javascript src="json2.js"> </script>
40 41
     </section>
42
+
43
+
41 44
 </body>
42 45
 </html>

+ 79
- 0
json2.js Visa fil

@@ -0,0 +1,79 @@
1
+// var url= "https://data.sfgov.org/api/views/yitu-d5am/rows.json?accessType=DOWNLOAD";
2
+//
3
+// var xmlhttp = new XMLHttpRequest();
4
+//
5
+// xmlhttp.onreadystatechange = function() {
6
+//     if (this.readyState == 4 && this.status == 200) {
7
+//         var myArr = JSON.parse(this.responseText);
8
+//        myFunction(myArr);
9
+//     }
10
+// };
11
+// xmlhttp.open("GET", url, true);
12
+// xmlhttp.send();
13
+//
14
+// function myFunction(arr) {
15
+//     var out = "";
16
+//     var i;
17
+//     for(i = 0; i < arr.length; i++) {
18
+//         out += '<a href="' + arr[i].url + '">' +
19
+//             arr[i].display + '</a><br>';
20
+//     }
21
+//     document.getElementById('result').innerHTML += out;
22
+// }
23
+
24
+// var jsonData;
25
+// var xhttp = new XMLHttpRequest();
26
+// xhttp.onreadystatechange = function() {
27
+//     if (this.readyState == 4 && this.status == 200) {
28
+//
29
+//         console.log(xhttp.response)
30
+//
31
+//          jsonData = JSON.parse(this.responseText);
32
+//
33
+//         var movies = jsonData.data;
34
+//         var result="";
35
+//         for( i=0;i<movies.length;i++){
36
+//             if(movies[i]=="Golden State Bridge"){
37
+//
38
+//             }
39
+//
40
+//         }
41
+//         // Action to be performed when the document is read;
42
+//     }
43
+// };
44
+// xhttp.open("GET", url, true);
45
+// xhttp.send();
46
+
47
+// var request = new XMLHttpRequest();
48
+// request.open('GET', url);
49
+// request.responseType = 'text';
50
+//
51
+// request.onload = function() {
52
+//     poemDisplay.textContent = request.response;
53
+// };
54
+//
55
+// request.send();
56
+
57
+
58
+var info = new XMLHttpRequest();
59
+info.onreadystatechange = function() {
60
+     if (this.readyState == 4 && this.status == 200) {
61
+           var res = info.responseText;
62
+            var jsonOutput = JSON.parse(res).data;
63
+            var list = document.getElementById("result");
64
+
65
+                for (var i=0; i<jsonOutput.length; i++){
66
+                  var elem = jsonOutput[i];
67
+                 if (elem[10] == "Golden Gate Bridge")
68
+                 {
69
+                        var movie = elem;
70
+                       list.innerHTML+= "<br/>" + elem[8];
71
+                        list.innerHTML += "<br/>" + elem[9];
72
+                        list.innerHTML += "<br/>" + elem[12] + "<br/>";
73
+                     };
74
+               }
75
+          }
76
+    };
77
+var url = "https://data.sfgov.org/api/views/yitu-d5am/rows.json?accessType=DOWNLOAD";
78
+info.open("GET", url, true);
79
+info.send();