A simple web application that uses the JavaScript Fetch API to retrieve user data from a public API and display it on the webpage.
Includes error handling, modern UI styling, navigation bar, footer, and a reload button.
- Fetches user data from:
https://jsonplaceholder.typicode.com/users - Displays:
- Name
- Address
- Modern UI using HTML + CSS
- Error handling with try/catch
- Reload button to refetch data
- Responsive card layout
- Navigation bar and footer included
- Network error testing supported (DevTools β Offline mode)
project-folder/ βββ index.html βββ app.js βββ README.md
- HTML5
- CSS3
- JavaScript (Fetch API)
- JSONPlaceholder API
- Chrome Browser / VS Code
Open the folder in VS Code.
Just open index.html in your browser:
- Right-click
index.html - Select Open with Live Server (or open normally)
You should see the styled user dashboard.
Click the Reload Users button to fetch fresh data anytime.
- Open Chrome DevTools
- Go to the Network tab
- Change dropdown to Offline
- Click Reload Users
β‘ You will see an error message on screen.
Data is fetched from the free public REST API:
https://jsonplaceholder.typicode.com/users
This project is open-source and free to use.
Md Shan Ansari Feel free to improve and extend this project!