This commit is contained in:
2024-12-20 22:09:12 +00:00
parent 723bcf1b03
commit f82ea59048
15 changed files with 2739 additions and 68 deletions

View File

@@ -0,0 +1,15 @@
//fetch: send a url request, client side rendering
//update the list, by default: fetch uses get
fetch('/get-todos', {method: 'GET'}). then((response) => {
response.json(). then((data) => {
const ol = document.querySelector('ol');
data.forEach((item) => {
//Create li
const li = document.createElement('li');
//add text to li
li.textContent = item;
//add li underneath (child) ol
ol.appendChild(li);
})
});
});