回答編集履歴

2

chousei

2019/07/17 06:17

投稿

yambejp
yambejp

スコア114883

test CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  window.addEventListener('DOMContentLoaded', function(e){
10
10
 
11
- fetch('y.php').then(data=>data.json()).then(data=>{
11
+ fetch('cake.json').then(data=>data.json()).then(data=>{
12
12
 
13
13
  var html="";
14
14
 

1

調整

2019/07/17 06:17

投稿

yambejp
yambejp

スコア114883

test CHANGED
@@ -8,19 +8,23 @@
8
8
 
9
9
  window.addEventListener('DOMContentLoaded', function(e){
10
10
 
11
- fetch('cake.json').then(data=>data.json()).then(data=>{
11
+ fetch('y.php').then(data=>data.json()).then(data=>{
12
12
 
13
13
  var html="";
14
14
 
15
15
  data.forEach(x=>{
16
16
 
17
- html+=`<div class="roomname" id="${x.room.name}"><h2>${x.room.id}</h2>`;
17
+ html+=`<div class="roomname" id="${x.room.name}"><h2>${x.room.id}</h2></div>`;
18
+
19
+ html+=`<div class="guest">`;
18
20
 
19
21
  x.item.forEach(y=>{
20
22
 
21
23
  html+=`<section><a href="${y.url}" data-lightbox="${x.room.id}"><img src="${y.url}"></a></section>\n`;
22
24
 
23
25
  });
26
+
27
+ html+=`</div>`;
24
28
 
25
29
  });
26
30