Difficult Javascript Problem!

Discussion in 'JavaScript' started by billabong, Dec 6, 2005.

  1. #1
    Hi guys,

    Here's one to rack your brains over.

    I want to use a javascript in order to change the color of some text depending on the current date. For example, i want to define 2 dates, and if the current date is within those 2 dates it displays one colored text and if it is outside that date it displays a different colored text.

    To get an example of what i mean go to www.ecampsite.co.uk/somerset.php

    If a campsite is open, the text will be green, and if it is closed it is orange. Is there any way to automate this with javascript??

    Your input regarding this will be invaluable!

    Thank you

    Craig
     
    billabong, Dec 6, 2005 IP
  2. strivinglife

    strivinglife Peon

    Messages:
    250
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    1) Where are you getting this content from? A database?

    2) If you've got PHP, why not use it instead of JS?

    Sounds pretty easy - the only questions are #1 and #2 :D
     
    strivinglife, Dec 6, 2005 IP
  3. billabong

    billabong Peon

    Messages:
    184
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    SOLVED - a good friend of mine (a bloody genius) has written some php code for me which solves my problem!!!
    Craig
     
    billabong, Dec 6, 2005 IP