Ahmed Zougari• 270
@zougari47
Posted
Hi there👋,
if you notice while clicking the button the quote doesn't change, this is how you can fix it
const getAdvice = () => {
fetch("https://api.adviceslip.com/advice", {
cache: 'no-cache'
})
.then((response) => response.json())
.then((data) => {
id.innerHTML = data.slip.id;
advice.innerHTML = data.slip.advice;
});
};
Happy coding
Marked as helpful
0
Dasu Rahul• 200
@dasurahul
Posted
@zougari47 Thanks Ahmed
0