回答編集履歴
1
chousei
answer
CHANGED
@@ -2,11 +2,19 @@
|
|
2
2
|
|
3
3
|
//sample.html
|
4
4
|
```javascript
|
5
|
+
const calcFileUpdate = async (a,b,c)=>{
|
5
|
-
const body=new FormData();
|
6
|
+
const body=new FormData();
|
6
|
-
body.append("
|
7
|
+
body.append("aaa",a);
|
7
|
-
body.append("
|
8
|
+
body.append("bbb",b);
|
9
|
+
body.append("ccc",c);
|
8
|
-
fetch("sample.php",{method:"post",body}).then(res=>res.text())
|
10
|
+
return await fetch("sample.php",{method:"post",body}).then(res=>res.text());
|
11
|
+
};
|
12
|
+
(async()=>{
|
13
|
+
const res=await calcFileUpdate(1,2,3);
|
14
|
+
console.log(res);
|
15
|
+
})();
|
9
16
|
```
|
17
|
+
※調整版
|
10
18
|
//sample.php
|
11
19
|
```PHP
|
12
20
|
<?PHP
|