add home javascript

This commit is contained in:
Yisroel Baum 2026-04-23 10:01:56 +03:00
parent 95ea38acfa
commit 1c2ca21f44
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

13
public/js/home.js Normal file
View file

@ -0,0 +1,13 @@
document.addEventListener('DOMContentLoaded', () => {
const textsList = document.getElementById('texts-list');
async function loadTexts() {
const response = await fetch('/api/texts');
const texts = await response.json();
textsList.innerHTML = texts
.map(text => '<li>' + text.name + '</li>')
.join('');
}
loadTexts();
});