Results 1 to 6 of 6

Thread: Need help with Basic Calendar Script

  1. #1
    Join Date
    Mar 2006
    Location
    NY
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Need help with Basic Calendar Script

    Basic Calendar Script:
    http://www.dynamicdrive.com/dynamici...iccalendar.htm

    I have been working on making my site universally friendly...even though I have FrontPage 03 as my editor. So I have been experimenting with adding java script.

    I believe I followed the directions for this script but I get missing object errors. I put the uploaded the .js file but am not sure if it is in the correct spot.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    To check on that we need a link to your page:

    PLEASE: Include the URL to your problematic webpage that you want help with.

    FrontPage itself can often mangle scripts, if that is the case, read on:

    Well, you might be able to configure FP so as to allow you to insert code like this without it mangling it so much. Read the manual or Google for help on that. Another alternative, and what I recommend in all cases like this, is to get your page looking like you want using FP but without any scripts. Save a copy of that somewhere to work on later if the need arises. Next open the page in notepad or simple text and add the scripts in according to the installation instructions, including any customization you've added. Never load this version of the page into FP ever again. To preview it locally, use the browser. To upload it, use FTP (preferred) or your host's online uploading tool.

    Here is another solution I ran across* but, since I do not use FP, I haven't tested it:

    In a text editor open the page whose code you which to preserve.

    At the beginning of the section of code you which to prevent FrontPage from modifying, add the following line of code:

    Code:
    <!--webbot bot="HTMLMarkup" startspan --> 
    At the end of the code section, add the following line of code:

    Code:
    <!--webbot bot="HTMLMarkup" endspan --> 
    Save the changes to the file. The next time the file is opened in FrontPage, FrontPage will not attempt to alter the code between the two HTMLMarkup tags.

    *Posted in these forums by usace-lrc and perhaps others.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2006
    Location
    NY
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanks!

    I thought about moving back and forth using notepad...I often have to paste information in notepad to remove formatting before pasting it in FP.

    The website (page) in question is:

    www.fishwithafly.net/availabilitytest.htm

    The actual page is similar, remove "test"

    Thanks for your VERY THOROUGH response!

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Looking at your source code, it looks as though you either didn't follow the directions or FP did something to your code to mangle it. Actually, since both script call:

    Code:
    <script type="text/javascript" src="basiccalendar.js">
    
    /***********************************************
    * Basic Calendar-By Brian Gosselin at http://scriptasylum.com/bgaudiodr/
    * Script featured on Dynamic Drive (http://www.dynamicdrive.com)
    * This notice must stay intact for use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    </script>
    and calendar style:

    Code:
    <style type="text/css">
    
    .main {
    width:200px;
    border:1px solid black;
    }
    
    .month {
    background-color:black;
    font:bold 12px verdana;
    color:white;
    }
    
    .daysofweek {
    background-color:gray;
    font:bold 12px verdana;
    color:white;
    }
    
    .days {
    font-size: 12px;
    font-family:verdana;
    color:black;
    background-color: lightyellow;
    padding: 2px;
    }
    
    .days #today{
    font-weight: bold;
    color: red;
    }
    
    </style>
    are missing entirely from the head of the document, it looks like you skipped some steps. Once those are remedied, it will become apparent where the calendars are and you might (will) wish to change that. The calendar calls:

    Code:
    <script type="text/javascript">
    
    var todaydate=new Date()
    var curmonth=todaydate.getMonth()+1 //get current month (1-12)
    var curyear=todaydate.getFullYear() //get current year
    
    document.write(buildCal(curmonth ,curyear, "main", "month", "daysofweek", "days", 1));
    </script>
    and similar are like divisions or tables, place them in your HTML markup like you would a division or table, not in the head.

    One other thing the drop down select appears not to be working even if the script call and style are added. I'm not sure why this is happening but, once again (for whatever reason) your code does not reflect the example for this.

    This bit in your source:

    HTML Code:
    <applet width="128" height="128" code="basiccalendar.js">
    				</applet>
    doesn't belong and the form tag is missing from around the script and select tag while instead it is wrapped in this link, causing it to load your index page when clicked:

    HTML Code:
    <a href="index.shtml">
    Even taking care of all that, there is still some error as all it then seems to do is switch to January, no matter what month is selected.

    Perhaps you should start by just trying to get one calendar working with no selects or other frills.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You're lucky (unless you really wanted to learn to do this yourself), I played around with this a bit more and came up with this demo, use your browser's 'view source' to see (and copy, if you like) the code.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Mar 2006
    Location
    NY
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Way to generous

    I do want to play around with it myself, and will, but your time solved my immediate concern. You have my contact information...if you are ever in the area and want to fish, look me up. Your help is worth a three hour "fish with your guide" trip.

    www.fishwithafly.net

Bookmarks

Posting Permissions

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