mpierse 6 gadus atpakaļ
vecāks
revīzija
86499ce4ec
1 mainītis faili ar 15 papildinājumiem un 3 dzēšanām
  1. 15
    3
      JS/index.js

+ 15
- 3
JS/index.js Parādīt failu

6
 
6
 
7
 xmlhttp.onreadystatechange=function() {
7
 xmlhttp.onreadystatechange=function() {
8
     if (this.readyState==4 && this.status==200) {
8
     if (this.readyState==4 && this.status==200) {
9
+      console.log(xmlhttp.response)
9
       data=JSON.parse(this.responseText);
10
       data=JSON.parse(this.responseText);
10
-    var movies = data.data;
11
-    var firstMovie = movies[i];
11
+     var movies = data.data;
12
+     var result = "";
13
+for (i=0; i<movies.length; i++){
14
+if(movies[i][10]==="Golden Gate Bridge"){
15
+  result += movies[i][8];
16
+  result += " : ";
17
+  result += movies [i][9];
18
+  result += ", ";
19
+  result += movies[i][12];
20
+  result += "<br>";
21
+}
22
+}
23
+document.getElementById('result').innerHTML = result;
24
+
12
 
25
 
13
-  document.getElementById('result').innerHTML += movies[1][10];
14
   }
26
   }
15
 }
27
 }
16
   xmlhttp.send();
28
   xmlhttp.send();