Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Thanked 0 Times in 0 Posts

    Trouble making this script

    I'm creating a simple script to redirect a page to a different html page by checking the day of the month. The script looks into the directory with the html pages listed 1 - 31 (i.e. 1.html, 2.html etc). What I want to do is make the javascript seach a particullar directory (menu) to find the html pages. Can any help?

    I have the following directory:

    Here is the script:

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    var today = new Date();
    var day = today.getDate();
    window.location = day + ".html";
    // End -->

    In this line
    window.location = day + ".html";
    can I change it to
    window.location = day + "/menu/.html";


  2. #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    In a place far, far away...
    Thanked 1,043 Times in 1,019 Posts
    i dont believe that is what u want, that will just look for a file called .html in directories 1-31 with subdirectory of menu, try this
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <script type="text/javascript">
    <!-- Begin
    var today = new Date();
    var day = today.getDate();
    window.location = "/menu/"+day+".html";
    // End -->
    that will start from the root directory then look in the menu folder and get the corresponding html file that matches the date


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts