/    Sign up×
Community /Pin to ProfileBookmark

image array created from directory

Hi, All

I’ve been working on some image scripts with arrays for a slideshow.

It works splendidly.

However, at present I have to manually enter each image that I wish to appear in the array.

Is there a way to create an index (wrong term?) for the array that would automatically create an image array from whatever images are in a given directory?

I’ve tried something like ‘images/’ + name + ‘.gif’ but to no avail.

Thanks in advance,

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@vickers_bitsJan 10.2003 — there certainly is, unfortunately not in client-side javascript (to my knowledge anyhow)

if you can use ASP it's pretty easy
Copy linkTweet thisAlerts:
@folsombobauthorJan 11.2003 — [i]Originally posted by vickers_bits [/i]

[B]there certainly is, unfortunately not in client-side javascript (to my knowledge anyhow)



if you can use ASP it's pretty easy [/B]
[/QUOTE]


Thanks for the reply, vickers_bits.

Unfortunately, I don't use ASP -- or should I say "yet". :-)
Copy linkTweet thisAlerts:
@swonJan 11.2003 — You can also use PHP,Perl etc., just any server side language!
Copy linkTweet thisAlerts:
@folsombobauthorJan 12.2003 — [i]Originally posted by swon [/i]

[B]You can also use PHP,Perl etc., just any server side language! [/B][/QUOTE]


Thanks, once more, swon.
Copy linkTweet thisAlerts:
@AH_CFeb 10.2003 — folsombob,

I think you can make it work with this code. I just downloaded it last night and in my rush, I didn't record the source--so my apologies to whomever should get the credit.
---------------------------------------


<!-- TWO STEPS TO INSTALL CURRENT DIRECTORY:

  • 1. Copy the coding into the HEAD of your HTML document

  • 2. Add the last code into the BODY of your HTML document -->


  • <!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

    <HEAD>

    <SCRIPT LANGUAGE="JavaScript">

    <!-- Original: Dan Worsham -->

    <!-- This script and many more are available free online at -->

    <!-- The JavaScript Source!! http://javascript.internet.com -->

    <!-- Begin

    var myloc = window.location.href;

    var locarray = myloc.split("/");

    delete locarray[(locarray.length-1)];

    var arraytext = locarray.join("/");

    // End -->

    </script>

    </HEAD>

    <!-- STEP TWO: Copy this code into the BODY of your HTML document -->

    <BODY>

    <center>

    <form>

    <input type=button value="Show Current Directory Listing (Or Index.html Page)" onClick="window.location=arraytext;">

    </form>

    </center>

    <p><center>

    <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>

    by <a href="http://javascriptsource.com">The JavaScript Source</a></font>

    </center><p>

    <!-- Script Size: 0.90 KB -->
    --------------------------------------------------


    To see how this works, simply everything between the dotted linesinto a text editor and save as html. It works and will return all files in the same folder as the file.

    HTH
    ×

    Success!

    Help @folsombob spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.16,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...