fetch('/world_comment') .then(response => response.json()) .then(data => { const container = document.getElementById('container'); data.forEach(entry => { const div = document.createElement('div'); div.id = 'l2'; div.style.setProperty('--t', entry.time); const innerDiv = document.createElement('div'); entry.items.forEach(item => { const span = document.createElement('span'); span.textContent = item; innerDiv.appendChild(span); }); div.appendChild(innerDiv.cloneNode(true)); // 克隆一份 innerDiv div.appendChild(innerDiv); // 添加原始 innerDiv container.appendChild(div); }); }) .catch(error => console.error('Error fetching data:', error));