@Omrankabo
Posted
i appreciate the hard work you did in this challenge , all the work you did. but why there is nothing showing when the page first loaded . you can set an event listener to the window to display a random advice when the page loads.
window.addEventListener("DOMContentLoaded", function () {
advice_number.textContent = data.id;
advice_description.textContent = data.advice;
});
Marked as helpful
@RuHd
Posted
@Omrankabo Thanks for the feedback! Maybe the request sometimes is not getting the data from the API . Because I've tested here and it's working fine when the page loads. But I will figure out the problem and solve it! Thanks again!