+ 1
JavaScript Image Loading Issue
Hey Guys, I recently created a JavaScript Image slider and when I was working in my text editor everything worked properly when I ran the script in Chrome. I inserted my script tag at the end of the body and I know when I bring it over to Sololearn the JS gets inserted into the head tag. I added a window onload declaration to load the JS after the content is loaded but my images arenât getting cycled through. I suspect that the window isnât refreshing to get the new image from unsplash but Iâm not sure whatâs happening. Any help is much appreciated. Thanks in advance for you guys help! https://code.sololearn.com/Wle9R0ZIV7zo/?ref=app
3 Answers
+ 4
All 3 images u have used are same. Look at the url in the array
0
Thanks Arushi,
I thought unsplash would generate a random image each time from the same url because I was using thier random image generator. I changed the urls and that fixed the issue.
0
Whats really odd is if I ran the code from my phone it would change images but not in my browser on my laptop before I changed the urls.