Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
153
rated 0 times [  156] [ 3]  / answers: 1 / hits: 38958  / 12 Years ago, thu, june 21, 2012, 12:00:00
var img = new Image();
img.src = images/myFolder/myImage.png;


The above will only load myImage.png. How to load all images of myFolder?


More From » image

 Answers
33

JavaScript can't directly access the contents of a file system. You'll have to pass the contents using a server-side script (written in PHP, etc) first.



Then once you have that, you can use a loop in your JavaScript to load them individually.


[#84744] Wednesday, June 20, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
annaw

Total Points: 18
Total Questions: 91
Total Answers: 98

Location: Guam
Member since Fri, Jun 18, 2021
3 Years ago
;