Random joke generator banner

Random joke generator

1 devlog
7h 13m 21s

The Joke Generator is a beginner-friendly web project that demonstrates how to use JavaScript for DOM manipulation and API integration. It creates UI elements dynamically and uses the Fetch API to request random jokes from an external source. The …

The Joke Generator is a beginner-friendly web project that demonstrates how to use JavaScript for DOM manipulation and API integration. It creates UI elements dynamically and uses the Fetch API to request random jokes from an external source. The application processes the JSON response and displays the joke (setup and punchline) on the webpage. This project helps in understanding asynchronous programming, event handling, and working with APIs in real-world scenarios.

This project uses AI

I used AI for making the readme file and for the description

Demo Repository

Loading README...

sakshikhushi25

Shipped this project!

I built a Random Joke Generator using JavaScript and an external API. The app creates a button dynamically and fetches a new joke every time the user clicks it. The hardest part was understanding how to use async/await with the Fetch API and handling the JSON response, but I figured it out by practicing and debugging my code. I’m really happy that I was able to connect an API and display real-time data on the screen. This project helped me improve my understanding of DOM manipulation and asynchronous JavaScript :)

sakshikhushi25

Started by planning a simple idea to build a joke generator using JavaScript and an external API.
Created the basic HTML file and linked the JavaScript file to it.
Used JavaScript to dynamically create a button and a paragraph element in the DOM.
Styled the page using JavaScript to keep the UI simple and centered.
Implemented an event listener on the button to trigger joke generation on click.
Used the Fetch API with async/await to request a random joke from the API.
Converted the response into JSON format and extracted the setup and punchline.
Displayed the joke on the screen by updating the paragraph text.
Tested the app multiple times to ensure jokes load correctly on each click.
Completed the project with a working API-based feature and better understanding of async JavaScript and DOM manipulation.

Attachment
0