Skip to content

itscodenation/flw1-u4l3-23-24-student-exercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lesson 4.3: APIs and DOM Manipulation

Objectives

  • Review click handlers and DOM manipulation concepts.
  • Learn about fetching data from a JSON file and using APIs.
  • Apply knowledge to work on projects.

Key Concepts

APIs (Application Programming Interfaces)

  • Definition: A set of protocols and tools for building application software and enabling communication between different software components.
  • Usage: APIs allow different applications to exchange data and functionalities easily.
  • Examples: Weather data for weather apps, movie databases for film apps, etc.

API Syntax in JavaScript

  • Fetching Data:
    fetch(url)
      .then(response => response.json())
      .then(data => {
        console.log(data);
      });
  • Using Data: Accessing data from JSON objects, e.g., data.question or data.answers[0].text.

DOM Manipulation and Click Handlers

  • Selecting Elements:
    let button = document.querySelector("button");
  • Adding Event Listeners:
    button.addEventListener("click", function() {
      console.log("It works!");
    });

Happy Coding! 😊

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published