+ 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

2nd Feb 2019, 7:52 PM
Brian Oliver
Brian Oliver - avatar
3 Antworten
+ 4
All 3 images u have used are same. Look at the url in the array
2nd Feb 2019, 9:53 PM
Arushi Singhania
Arushi Singhania - avatar
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.
2nd Feb 2019, 10:32 PM
Brian Oliver
Brian Oliver - avatar
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.
2nd Feb 2019, 10:57 PM
Brian Oliver
Brian Oliver - avatar