回答編集履歴

1

chousei

2021/07/27 01:37

投稿

yambejp
yambejp

スコア116738

test CHANGED
@@ -6,15 +6,31 @@
6
6
 
7
7
  ```javascript
8
8
 
9
- const body=new FormData();
9
+ const calcFileUpdate = async (a,b,c)=>{
10
10
 
11
- body.append("a"," 123");
11
+ const body=new FormData();
12
12
 
13
- body.append("b","456 ");
13
+ body.append("aaa",a);
14
14
 
15
+ body.append("bbb",b);
16
+
17
+ body.append("ccc",c);
18
+
15
- fetch("sample.php",{method:"post",body}).then(res=>res.text()).then(console.log);
19
+ return await fetch("sample.php",{method:"post",body}).then(res=>res.text());
20
+
21
+ };
22
+
23
+ (async()=>{
24
+
25
+ const res=await calcFileUpdate(1,2,3);
26
+
27
+ console.log(res);
28
+
29
+ })();
16
30
 
17
31
  ```
32
+
33
+ ※調整版
18
34
 
19
35
  //sample.php
20
36