index.html 556 B

123456789101112131415161718192021222324252627
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>dumptruc</title>
  5. </head>
  6. <body>
  7. <div class="page">
  8. <h1>dumptruc</h1>
  9. <ul class="todos">
  10. </ul>
  11. </div>
  12. <script src="https://unpkg.com/jquery@3.5.1/dist/jquery.js">
  13. </script>
  14. <script>
  15. $.ajax({
  16. url: '/todo',
  17. dataType: 'json',
  18. success: (data, _1, _2) => {
  19. for (const todo of data["todos"]) {
  20. $(".todos").append(
  21. `<li class="todo">${todo.item}</lix>`
  22. );
  23. }
  24. }});
  25. </script>
  26. </body>
  27. </html>