回答編集履歴
2
インデント
test
CHANGED
@@ -28,15 +28,15 @@
|
|
28
28
|
|
29
29
|
fetch(evt.target.href)
|
30
30
|
|
31
|
-
.then(res => res.json())
|
31
|
+
.then(res => res.json())
|
32
32
|
|
33
|
-
.then(user => {
|
33
|
+
.then(user => {
|
34
34
|
|
35
|
-
document.querySelector("#user-id").value = user.id;
|
35
|
+
document.querySelector("#user-id").value = user.id;
|
36
36
|
|
37
|
-
document.querySelector("#user-name").value = user.name;
|
37
|
+
document.querySelector("#user-name").value = user.name;
|
38
38
|
|
39
|
-
});
|
39
|
+
});
|
40
40
|
|
41
41
|
}, false);
|
42
42
|
|
1
追記
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
サーバーの処理の中で、そのURLにリクエストを送り、データをJSONで受け取り、
|
4
4
|
|
5
|
-
そのデータを使ってHTMLを作成し、レスポンスに出力するということもできます。
|
5
|
+
そのデータを使ってHTML(移った後のhtmlとおしゃっている部分)を作成し、レスポンスに出力するということもできます。
|
6
6
|
|
7
7
|
以下はJavaScriptで取得する例です。
|
8
8
|
|