Originally posted by: dighn
if you have the perl script in /slide_show
then you can modify the <script> tag from that page to
<script
src="/cgi-bin/script.cgi?NumberOfFiles&images"
type="text/javascript"
language="JavaScript">
</script>
the rest should be the same
Thanks - How can I call this function from the js code?Originally posted by: Chebago
I wrote this function in php, it will give you an array of all the files in a given directory...it could be easily modified to return the size of the array instead...
Originally posted by: MrNutz
Originally posted by: dighn
if you have the perl script in /slide_show
then you can modify the <script> tag from that page to
<script
src="/cgi-bin/script.cgi?NumberOfFiles&images"
type="text/javascript"
language="JavaScript">
</script>
the rest should be the same
Thanks for the help.
I guess my real question is that if the perl script is in the /slide_show/ directory, then would the src="/cgi-bin/script.cgi?NumberOfFiles&images" tag still point to the /cgi-bin directory?
My slide show actually cycles through x number of images automatically or manually depending on the user's desire. It does this by increasing the image file's number in the image file name. (i.e. image_001.jpg, image_002,...,image_055,etc.)Originally posted by: Chebago
I might be confused on what exactly you are trying to do, one thing would be to just call my function and then have it take a random picture and display it...is your slideshow one that you want to do in the background, such as switching a header image every now and again, I tried your links, but they didn't work for me, so I am kind of confused why you want to do this in javascript. If it is just for showing a group of images like family pictures, my function should work and then just refresh the page with a new url every 5 seconds or something...
Originally posted by: MrNutz
My slide show actually cycles through x number of images automatically or manually depending on the user's desire. It does this by increasing the image file's number in the image file name. (i.e. image_001.jpg, image_002,...,image_055,etc.)Originally posted by: Chebago
I might be confused on what exactly you are trying to do, one thing would be to just call my function and then have it take a random picture and display it...is your slideshow one that you want to do in the background, such as switching a header image every now and again, I tried your links, but they didn't work for me, so I am kind of confused why you want to do this in javascript. If it is just for showing a group of images like family pictures, my function should work and then just refresh the page with a new url every 5 seconds or something...
So basically I just need to know how many files are in the image folder and that will tell me the highest image number / last filename. I'm starting to really like the php approach b/c that is more independent than the perl approach which can be different from server to server.