Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying part of a table on a particular date?

Status
Not open for further replies.

budgy

Programmer
Jan 4, 2005
73
GB
Hiya guys I really hope you can help me out here. I have been breifed to design a page with a competition banner, only i want this banner to be visable during a particular time period. Live date for it is on a saturday and i wont be here to publish. I was hoping someone could help me out with some coding that would allow the default page to display a particular part of the table with the banner on the competition day. Here is what Ive managed to come up with

Code:
<script language="JavaScript"><!--
var today = new Date();
var number = today.getDate() + 1;
if (number>20)
{
<!--document.write('<th height="81" background="images/comp_strrap.jpg" scope="row"><a href="[URL unfurl="true"]http://click.dixons.co.uk/scripts/SComp/competition_d1.asp"><img[/URL] src="images/transparent.gif" width="729" height="58" border="0"></a>');

                ('<th height="81" background="images/comp_strrap.jpg" scope="row"><a href="[URL unfurl="true"]http://click.dixons.co.uk/scripts/SComp/competition_d1.asp"><img[/URL] src="images/transparent.gif" width="729" height="58" border="0"></a> 
                </th>')
}
//--></script>

Any suggestion or guildence will be greatfully appreciated.

Thanks in advance

"He that asks a question is a fool for a moment, he that never asks a question is a fool all his life
 
i think the client you are advertising for would much rather you handle this on the server side rather than relying on viewers enabling javascript on their local machines.

*cLFlaVA
----------------------------
[tt]I already made like infinity of those at scout camp...[/tt]
beware of active imagination: [URL unfurl="true"]http://www.coryarthus.com/[/url]

BillyRayPreachersSonIsTheLeetestHax0rDude
[banghead]
 
I agree with cLFlaVA on this one. This sort of thing should very much be handled server-side. Do you have any server-side scripting you can use?

Not only will client-side JS only work if the user has JS enabled, but your banner will appear or dissapear depending on their local PC clocks being correct or not.

Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top