From the course: Programming Foundations: Application Architecture
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Code walkthrough: To-do list application
From the course: Programming Foundations: Application Architecture
Code walkthrough: To-do list application
Let's examine the code involved in this to-do list application. We'll start by exploring the different files involved in the front end. First, there's the index.html. This file sets up the basic structure of our application, including the necessary elements for the user interface. This includes a form for entering new tasks, a submit button, and an unordered list to display the tasks. There's also a link to the JavaScript file that handles the application's logic. Let's take a look at the script.js. This file handles interactions with the back end and updates the user interface. Once the initial HTML document has been completely loaded and parsed, this callback function is executed. We retrieve the HTML elements and set up event listeners that will be triggered when they're interacted with. Then we create a function that sends a GET request to the task's endpoint to retrieve the list of tasks from the server. It converts the server's JSON response into a JavaScript array of task…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.