简体   繁体   中英

Problem in displaying all images inside the folder using javascript

Hi,

For my project I m using jquery bulit in photo slide show,jquery code is taking images from array and displaying the images..The problem is I have a lot of images which I don't want to put it in Array(because it need manual effort) instead of that I want to read each image from the folder and display the images. the advantage of doing so is whenever you want to add more images you need to drop it in folder since you are reading images from folder so need not to do any thing in code level.so it makes your work easier and simpler.. so is there any way to achieve the same using javascript?.

Thanks in Adavance.

Javascript being client-side, it's possible to list the content of a server directory with it. You'll need some server side scripting to do that, like PHP. see this SO question for an example

I think you should add an Ajax request to get the names of file in the directory.

After you can just pass along the array and show only those images in the slideshow.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM