-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathacm.js
More file actions
23 lines (23 loc) · 685 Bytes
/
acm.js
File metadata and controls
23 lines (23 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function fetchdata(){
fetch("https://wcenewslet.herokuapp.com/non-ciriculum/clubs")
.then(response => {
console.log(response)
if(!response.ok){
throw Error("Error");
}
return response.json();
// console.log(data);
})
.then(data => {
console.log(data.data);
const html =data.data.map(user =>{
return `<p>Name: ${user.clubname + " "+ user.msg}</p>`
}).join("");
console.log(html);
document.querySelector("#UPDATES")
.insertAdjacentHTML('afterbegin',html);
}).catch(error =>{
console.log(error);
});
}
fetchdata();