回答編集履歴
1
sample
answer
CHANGED
@@ -2,4 +2,20 @@
|
|
2
2
|
|
3
3
|
をどう変換するか次第です。
|
4
4
|
何らかの変換テーブルを用意するならtxtはajaxで読み込み
|
5
|
-
合致するデータを置き換える処理をかけばいいでしょう
|
5
|
+
合致するデータを置き換える処理をかけばいいでしょう
|
6
|
+
|
7
|
+
# sample
|
8
|
+
- test.txt
|
9
|
+
```text
|
10
|
+
"1","2","3"
|
11
|
+
```
|
12
|
+
|
13
|
+
- test.htm
|
14
|
+
```javascript
|
15
|
+
<script>
|
16
|
+
const list={1:"話す",2:"歩く",3:"寝る"};
|
17
|
+
fetch('y.php').then(res=>res.text()).then(res=>JSON.parse("["+res+"]")).then(res=>{
|
18
|
+
console.log(...res.map(res=>list[res]));
|
19
|
+
});
|
20
|
+
</script>
|
21
|
+
```
|