Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Calendar Questions...

djshadmegodjshadmego Member Posts: 27
Here is something people can laugh at. But to be honest, I am at the end of myself with this. I can't find any resources to help me with this problem except here and I hate to seem young and inexperienced, but I don't know what I am doing wrong. Here is the code for a calendar I am trying to write. Please pick it apart if you have time and tell me why it wont advance/go back a month, and why it doesn't even load correctly. By the way, this is to be the framework for an events calendar that will be updated through Perl or MySQL database. If that matters in your reading of the code. Thank you for helping and not laughing at me too hard.

Dj
[code]






[/code]

Comments

  • gaspardgaspard Member Posts: 14
    : Here is something people can laugh at. But to be honest, I am at the end of myself with this. I can't find any resources to help me with this problem except here and I hate to seem young and inexperienced, but I don't know what I am doing wrong. Here is the code for a calendar I am trying to write. Please pick it apart if you have time and tell me why it wont advance/go back a month, and why it doesn't even load correctly. By the way, this is to be the framework for an events calendar that will be updated through Perl or MySQL database. If that matters in your reading of the code. Thank you for helping and not laughing at me too hard.
    :

    TO DJ: I will put comments into the code below to show which parts have obvious problems:

    [code]
    :
    :
    :
    :
    :
    :
    [/code]


  • gaspardgaspard Member Posts: 14
    : Here is something people can laugh at. But to be honest, I am at the end of myself with this. I can't find any resources to help me with this problem except here and I hate to seem young and inexperienced, but I don't know what I am doing wrong. Here is the code for a calendar I am trying to write. Please pick it apart if you have time and tell me why it wont advance/go back a month, and why it doesn't even load correctly. By the way, this is to be the framework for an events calendar that will be updated through Perl or MySQL database. If that matters in your reading of the code. Thank you for helping and not laughing at me too hard.
    :

    OOPS, I missed a few bits...
    the call to nextMonth(); and prevMonth(); needed to be:
    nextMonth(todayMonth); and prevMonth(todayMonth);
    also I've re-encapsulated the rest of the doc.writing in a writeCal() function, so the page can be updated after changing the value of todayMonth..
    This only works once, because once the page is re-written, it no longer contains the function definitions... DOH..


    here is a version of your code that is cleaned up, and works once in either direction (next or prev), the reason it works only once, is that all the javascript disappears from the source of the page when we re-write the page to update it...
    (below I have another couple of solutions to your problem)

    [code]






    [/code]

    That's not so good...



    but, if we doc.write(); to a seperate window, the home/control window can remain un-written to, thus retaining it's functions...
    try this one just for kicks
    (it works perfectly with the buttons in the control window)

    Calender in two windows:
    [code]






    [/code]


    My other suggestion is to use the .innerText or .innerHTML properties of a
    that incloses the whole lot (will work only in IE 5+)
    here is an example of this method of retaining the 1 window:

    YOU'LL LOVE how this one works...

    Internet Explorer 5+ with DHTML is so cool!

    [code]









    [/code]

Sign In or Register to comment.