1
I have an application where large data in AJAX requests are made, this generates a certain delay to place the data on the page.
I need to render an image where your path is a array. In my understanding the browser tries to load the image once but the array has not yet been processed, generating an error in the console. The browser tries to find the image again and in that attempt it succeeds because the array has already been processed.
For a user it would not see any problem, but on the console I get an error from
Undefined
Based on this follows some doubts:
- We must always eliminate mistakes no matter how visually everything is "right"?
- The best way to resolve the situation would be with a
Catch
? - Is there any technique or tendency to make a late shipment?
you then need to load the images after the array, if there is such a dependency, this is the right one to do
– Ricardo Pontual
"On my notice the browser tries to load the image once but the array has not been processed yet" - would be the case to fix so that it doesn’t happen this way, since you managed to diagnose the problem.
– Bacco