1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Java script modification question

Discussion in 'Software Development' started by bassetman, Apr 2, 2004.

Thread Status:
Not open for further replies.
  1. bassetman

    bassetman Moderator (deceased) - Gone but never forgotten Thread Starter

    Joined:
    Jun 7, 2001
    Messages:
    47,973
    I would like to have this part of a script grab the "pics" from a different Directory, so that I can run another version on a different page with different pics.

    Sooo... how do I modify this to have it grab the pics from a Dir (such as Images)?

    PHP:
    <script language="javascript1.1">

    today = new Date();
    day today.getDay();

    arday = new Array("Sunday.jpg""Monday.jpg""Tuesday.jpg""Wednesday.jpg""Thursday.jpg""Friday.jpg""Saturday.jpg");

    document.write("<img src='" arday[day] + "'>");

    </script><P>
     
  2. Shadow2531

    Shadow2531

    Joined:
    Apr 30, 2001
    Messages:
    2,636
    Code:
    document.write('<img src="Images/' + arday[day] + '">');
    
    (assuming the Images folder is a subfolder of the current folder.)
     
  3. bassetman

    bassetman Moderator (deceased) - Gone but never forgotten Thread Starter

    Joined:
    Jun 7, 2001
    Messages:
    47,973
    Thanks! ;)
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/216896

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice