Results 1 to 4 of 4
  1. #1
    Bronze Lounger
    Join Date
    Jun 2001
    New York, New York, Lebanon
    Thanked 1 Time in 1 Post

    What Technology can I use to...

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Loungers

    New, very new in fact this is my very first project, to web design, and what I want to do is the following:

    I have a list of events, for a whole month. Today this is going on, tomorrow something else yada yada yada... When the User comes to the site, I want to:

    1) Read the Date on the PC, or know the date from some place,
    2) Scroll the page to display only the current date and the future dates, but not past dates, so...

    If a user comes today, they will see May 17th and forward only.

    Maybe we'll give them a button for past events but then that is easy...

    Thanks for telling me how easy it is, and giving me a nudge in the right direction.

    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  2. #2
    Silver Lounger Bruce K's Avatar
    Join Date
    Apr 2002
    Phoenix, Arizona, USA
    Thanked 0 Times in 0 Posts

    Re: What Technology can I use to...

    Hi, Wassim ~

    Fetching the client side date/time is often done with javascripts. The scrolling feature you are seeking I am sure can be accomplished the same way, but you will have to sift throught the many at the aforelisted link.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Silicon Valley, USA
    Thanked 93 Times in 89 Posts

    Re: What Technology can I use to...

    Let's assume you have a home page, index.html, where you have a link like this:

    Click here to see our events calendar

    That page will load at the top. To scroll the simplest possible way, you would place <a name="xyz"></a> tags (what FrontPage calls "bookmarks") at the beginning of the paragraph or table cell for each date in events.html. These bookmarks could, for example, be the day of the month.

    You then need to doctor your link in index.html so that it takes this form:

    Click here to see our events calendar on the 17th of the month.

    On the client side, using JavaScript, which most users do run, you have at least two possible approaches: (1) set the contents of the link when the page loads, or (2) change the link to run a JavaScript function (either in the <a> tag or in a <script> tag).

    On the server side, HTML pages are static, period. If you want the user's index page to come already customized, you need to learn about either server side includes (.shtml) or active server pages (.asp) or java server pages (.jsp) or php, etc., which all allow you to do fancy stuff on the server to deliver precisely the right link.

    For now, let's do the simplest of the second JavaScript options. The following do the same thing, assuming the user enables java script:

    Click here to see our events calendar
    Click here to see our events calendar

    To build in an automatic way to add the day of the month, you could do this:

    Click here to see our events calendar

    But what if the user has JavaScript disabled (or set to Prompt, and doesn't let the script run)? Nothing. Link doesn't work. So really, this cure could be worse than the disease. You could instead use an onLoad function to "edit" the link. This would work for those who have JavaScript, and those who don't would get a link that takes them to the top of the events page. To do this, you would first need to add an ID attribute to your <a> tag:

    Click here to see our events calendar

    Then, in the <HEAD> part of your page, you'd add a just little script, a-like this:

    function CustomizeLink(strLinkID)
    //Compatible with IE5+ and NS6+
    var myLink = document.getElementById(strLinkID);
    var d = new Date();
    myLink.href = myLink.href + "#" + d.getDate();

    Finally, in the <BODY> tag, you would add onLoad="CustomizeLink('eventlink');" before the closing >.

    When the browser loads the page on the 17th, it will tack #17 onto the end of the URL in the <a> tag. Like magic.

    Now... if you want to get fancy... you could add browser detection code to try to help out users of older browsers. As you can see, I have used W3C standards-compliant code that doesn't work with Netscape 4 and might not work with IE4. But I think then you're turning a fun idea into a coding nightmare, so I'll stop here. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  4. #4
    5 Star Lounger
    Join Date
    Jul 2002
    Toronto, Ontario, Canada
    Thanked 0 Times in 0 Posts

    Re: What Technology can I use to...

    Depending on what is available on your Web Server (ASP, PHP, MySQL Database, PostGreSQL database,...) you can find already built Calendars that you can just configure and upload it to your site and it's ready to go.

    All you usually have to do is fill in some connection info (DB username and password) and then just add the items to the calendar througha web form.
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

Posting Permissions

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