សំណួរ
១. តើ AJAX ជាអ្វី?
២. អ្វីទៅជា HTTP
៣. តើសំណើរប្រភេទ GET និង POST ខុសគ្នាដូចម្តេចខ្លះ?
លំហាត់អនុវត្តន៍
Task 1
Implement a web page “Catalogue of Copywriters”
The user opens the page and sees the names of all available
copywriters displayed. Get data using the AJAX request taken from
JSONPlaceholder.
- Send the GET request at https://jsonplaceholder.typicode.com/users.
- Get a response in the JSON format. The response is an array consisting of 10 users.
- Parse these data and write them in the collection of objects of the User data type.
- Create HTML elements and add them to DOM.
When the copywriter is selected, their detailed information and the Show posts button are displayed below.
In order to get a detailed information, send the request to the same address https://jsonplaceholder.typicode.com/users, but this time add an id parameter with the required value. As a result, the address will look as follows: https://jsonplaceholder.typicode.com/users?id=2, or the short version: https://jsonplaceholder.typicode.com/users/2.
If this API doesn’t work either, you will have to find another available resource on your own and adjust your task.