Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Web Design (WordPress, Joomla, etc.) javascript updates by day

  • javascript updates by day

    Posted by Dan Mcguire on January 23, 2006 at 3:31 pm

    Folks,

    I am building a site for a YMCA. Each day there are different fitness classes, and I would like the main page to show the current day’s classes. I have a script that puts up a new message based on the our of the day, <https://www.javascript-page.com/chclock.html>but I want the message to update based on the day of the week.

    The other option would be to have a seven different main pages placed on my server for each day of the week. But how would I communicate to the server to tell it to load the appropriate page on a daily basis.

    Forgive the newbie nature of this question.

    Thanks
    DAN

    Curtis Thompson replied 20 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Curtis Thompson

    January 23, 2006 at 4:56 pm

    hello…

    well – with either javascript or a server-side scripting language, you can retrieve the day of the week from a date object – it’s either typically returned as a numer (0-6) or you can return it as a string value in some date functions (like in php)…but that will give you the power you need to show something based on what day it is…

    if you had a schedule file to show, you have a few options. one would be to use a server-side script like php and just test with that script and show the appropriate schedule. another would be to use javascript and an iframe with either name jumps or separate schedule files. i made an example of that (with the latter) here:

    https://sitruc.com/cow/dyn_schedule/index.html

    hope that helps!

    sitruc

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy