質問編集履歴
6
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
"sample2": "BBBB",
|
11
11
|
"list2": [
|
12
12
|
{
|
13
|
-
"sample3": "CCCC"
|
13
|
+
"sample3": "CCCC"
|
14
14
|
}
|
15
15
|
]
|
16
16
|
}
|
5
誤字
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
JSONデータをJavascript
|
1
|
+
JSONデータをJavascript(XMLHttpRequest)を使って取得する
|
test
CHANGED
File without changes
|
4
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -46,7 +46,7 @@
|
|
46
46
|
let section = document.querySelector('.sample');
|
47
47
|
|
48
48
|
els.forEach(function(el) {
|
49
|
-
let sample = el.
|
49
|
+
let sample = el.sample3;
|
50
50
|
|
51
51
|
let sampleCode =
|
52
52
|
'<p>' + sample + '</p>';
|
3
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
```
|
31
31
|
let requestURL = 'sample.json';
|
32
32
|
let request = new XMLHttpRequest();
|
33
|
-
request.open('GET',
|
33
|
+
request.open('GET', requestURL);
|
34
34
|
request.responseType = 'json';
|
35
35
|
|
36
36
|
request.send();
|
2
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,15 +28,15 @@
|
|
28
28
|
### 該当のソースコード
|
29
29
|
|
30
30
|
```
|
31
|
-
let
|
31
|
+
let requestURL = 'sample.json';
|
32
|
-
let
|
32
|
+
let request = new XMLHttpRequest();
|
33
|
-
|
33
|
+
request.open('GET', alertURL);
|
34
|
-
|
34
|
+
request.responseType = 'json';
|
35
35
|
|
36
|
-
|
36
|
+
request.send();
|
37
37
|
|
38
|
-
|
38
|
+
request.onload = function() {
|
39
|
-
let listJSON =
|
39
|
+
let listJSON = request.response;
|
40
40
|
listJSON = JSON.parse(JSON.stringify(listJSON.list1.0001));
|
41
41
|
|
42
42
|
pageList(listJSON.list2)
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,7 +28,7 @@
|
|
28
28
|
### 該当のソースコード
|
29
29
|
|
30
30
|
```
|
31
|
-
let alertURL = '
|
31
|
+
let alertURL = 'sample.json';
|
32
32
|
let alertRequest = new XMLHttpRequest();
|
33
33
|
alertRequest.open('GET', alertURL);
|
34
34
|
alertRequest.responseType = 'json';
|