回答編集履歴

1

誤字の修正

2019/06/13 06:59

投稿

YukiYamashina
YukiYamashina

スコア1011

test CHANGED
@@ -12,27 +12,27 @@
12
12
 
13
13
  req.open("get", "test.csv", true); // アクセスするファイルを指定
14
14
 
15
- xhr.onload = () => {
15
+ req.onload = () => {
16
16
 
17
- if (xhr.readyState === 4 && xhr.status === 200) {
17
+ if (req.readyState === 4 && req.status === 200) {
18
18
 
19
- resolve(convertCSVtoArray(xhr.responseText));
19
+ resolve(convertCSVtoArray(req.responseText));
20
20
 
21
21
  } else {
22
22
 
23
- reject(new Error(xhr.statusText));
23
+ reject(new Error(req.statusText));
24
24
 
25
25
  }
26
26
 
27
27
  };
28
28
 
29
- xhr.onerror = () => {
29
+ req.onerror = () => {
30
30
 
31
- reject(new Error(xhr.statusText));
31
+ reject(new Error(req.statusText));
32
32
 
33
33
  };
34
34
 
35
- xhr.send(null); // HTTPリクエストの発行
35
+ req.send(null); // HTTPリクエストの発行
36
36
 
37
37
  });
38
38