質問編集履歴
2
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,62 +18,4 @@
|
|
18
18
|
|
19
19
|
?>
|
20
20
|
|
21
|
-
```javascript
|
22
|
-
|
23
|
-
$(function(){
|
24
|
-
|
25
|
-
$.ajax({
|
26
|
-
|
27
|
-
type:"POST",
|
28
|
-
|
29
|
-
url:"json.php",
|
30
|
-
|
31
|
-
dataType:"json",
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
}).done(function(json){
|
36
|
-
|
37
|
-
var data = JSON.parse(json);
|
38
|
-
|
39
|
-
function plotres(data,prefix){
|
40
|
-
|
41
|
-
for(var key in arr_data){
|
42
|
-
|
43
|
-
if(typeof data[key] == "object"){
|
44
|
-
|
45
|
-
if(Array.isArray(data[key])){
|
46
|
-
|
47
|
-
data[key].forEach(function(item){
|
48
|
-
|
49
|
-
plotres(item,plefix+" "+key);
|
50
|
-
|
51
|
-
});
|
52
|
-
|
53
|
-
}else{
|
54
|
-
|
55
|
-
plotres(data[key],prefix+" "+key);
|
56
|
-
|
57
|
-
}
|
58
|
-
|
59
|
-
}else{
|
60
|
-
|
61
|
-
console.log(prefix+" "+key+":"+data[key]);
|
62
|
-
|
63
|
-
}
|
64
|
-
|
65
|
-
}
|
66
|
-
|
67
|
-
}
|
68
|
-
|
69
|
-
})
|
70
|
-
|
71
|
-
});
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
```
|
21
|
+
```jav
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
お天気情報APIの配列をコンソールに表示させたいのですが、上記のコードだとコンソールになにも表示されません。なぜかわかりませんか?
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
|
27
27
|
type:"POST",
|
28
28
|
|
29
|
-
url:"json
|
29
|
+
url:"json.php",
|
30
30
|
|
31
31
|
dataType:"json",
|
32
32
|
|