In my work with Slideshows and wanting to display an image on my home page that changed everytime I loaded it I may have over-complicated things and confused myself.
The use of an array of images, where they were "pulled" from the server and placed in the array is far too wasteful on resources. An an array of URL's to the images would have sufficed.
Arrays in HTML
The creation of an array of URLs to image files is used extensively on this website.
The summary below was generated by AI:
HTML itself does not have arrays — arrays are a JavaScript feature.
If you want to work with arrays in a web page, you use JavaScript inside your HTML.
Many of the DOM Methods to select elements etc create and return arrays of elements in an array or an array like object. For example the getElementsByClassName() method returns such an object.
Function to build an array of image URLs
Top
This is a single dimension array a JSON object would be better. Or is it? I could just use multiple single dimension arrays.