Answer the question
In order to leave comments, you need to log in
API update without page reload?
Help an inexperienced jun..!
In the test task, a random api was attached ( https://www.colr.org/json/color/random ). The API each time returns a random object that should be drawn on the page, there is a skip button, the object returned to the API should be updated on click. The API should be called once on page load, the skip button should be updated randomly.
I can not understand how the API update is implemented if the API call is made only 1 time when the page is loaded.
Answer the question
In order to leave comments, you need to log in
bind the API call to the skip button, or add the missing property to the collection and do not display it
as I understand it, the point is that when you enter the page for the first time - of course, pull the apishka (in the user effect), so that something is immediately displayed. and then, on click (randomly) on the button, also call the same API every time to update the object
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question