This is a discussion on "Difficult Javascript Problem!" within the JavaScript Forum section. This forum, and the thread "Difficult Javascript Problem! are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Difficult Javascript Problem!
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
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 |
|
|
|
||||
|
i dont have have a database, would you be able to do it thru just php on a page, that would be a mega help!!!
|
|
|||
|
Re: Difficult Javascript Problem!
yeah you can use if statments, for example:
php:
|
|
|||
|
Re: Difficult Javascript Problem!
you see this would be easier if you had a database...
as each date will have to be a variable so you have to edit each page...so basicly just adding the colour yourself would be better... if you had a database you could just have an admin backend and make the script do all the work... |
|
||||
|
Re: Difficult Javascript Problem!
SOLVED - a good friend of mine (a bloody genius) has written some php code for me which solves my problem!!!
Craig
|
![]() |
| Tags |
| difficult, javascript, problem |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Would this be difficult to do | AdRock | Webforumz Suggestions and Feedback | 6 | Nov 6th, 2007 12:42 |
| Javascript problem | zc1 | JavaScript Forum | 2 | Jan 15th, 2007 17:01 |
| Is something like this too difficult to create? | andresnav | Introduce Yourself | 7 | Nov 19th, 2006 05:58 |
| too difficult for a noob | Cam | PHP Forum | 5 | Feb 4th, 2004 22:15 |
| CSS Difficult? | Galaxyblue | Web Page Design | 11 | Jan 27th, 2004 19:18 |