Roosterman3000
05-07-2003, 01:02 PM
Hi again this was another class assignment that I want to fix.
I am not sure if its all done correctly but we were to post the current date and then we were to count the days left to Christmas. I have that much done at least what the book shows but I want to add a background image rather than have the back ground white. also I am not sure how to change the font color inside of the box. as i said i just finished it right now i am a beginner as far as JS so bare with me as most of you have already thanks again.
Here Is what I have so far.......
<html>
<head>
<script language="javascript">
<!--Hide from non-javascript browsers
function XmasDays(CurrentDay) {
var XYear=CurrentDay.getFullYear();
var XDay=new Date("December, 25, 2003");
XDay.setFullYear(XYear);
var DayCount=(XDay-CurrentDay)/(1000*60*60*24);
DayCount=Math.round(DayCount);
return DayCount;
}
function Daytxt(Daynumber) {
var Day=new Array();
Day[1]="Sunday";
Day[2]="Monday";
Day[3]="Tuesday";
Day[4]="Wednesday";
Day[5]="Thursday";
Day[6]="Friday";
Day[7]="Saturday";
return Day[Daynumber];
}
function Monthtxt(Monthnumber) {
var Month=new Array();
Month[1]="January";
Month[2]="February";
Month[3]="March";
Month[4]="April";
Month[5]="May";
Month[6]="June";
Month[7]="July";
Month[8]="August";
Month[9]="September";
Month[10]="October";
Month[11]="November";
Month[12]="December";
return Month[Monthnumber];
}
// stop hiding -->
</script>
</head>
<body>
<table border="0" width="35%" bgcolor="#FFFFFF" align="center">
<tr>
<td id="daycell" style="color:"Blue">
<p align="center">
<script language="javascript">
<!--Hide from non-javascript browsers
var Today=new Date();
var thisDay=Today.getDate();
var thisMonth=Today.getMonth()+1;
var thisYear=Today.getFullYear();
var Dayout=Today.getDay()+1;
var Daysleft=XmasDays(Today);
var Dayname=Daytxt(Dayout);
var Monthname=Monthtxt(thisMonth);
document.write("The Date Today Is : "+Dayname+" "+Monthname+" "+thisDay+", "+thisYear+"<br>");
document.write("There are "+Daysleft+" days until Christmas!");
//stop hiding-->
</script>
</p>
</td>
</table>
</body>
</html>
I am not sure if its all done correctly but we were to post the current date and then we were to count the days left to Christmas. I have that much done at least what the book shows but I want to add a background image rather than have the back ground white. also I am not sure how to change the font color inside of the box. as i said i just finished it right now i am a beginner as far as JS so bare with me as most of you have already thanks again.
Here Is what I have so far.......
<html>
<head>
<script language="javascript">
<!--Hide from non-javascript browsers
function XmasDays(CurrentDay) {
var XYear=CurrentDay.getFullYear();
var XDay=new Date("December, 25, 2003");
XDay.setFullYear(XYear);
var DayCount=(XDay-CurrentDay)/(1000*60*60*24);
DayCount=Math.round(DayCount);
return DayCount;
}
function Daytxt(Daynumber) {
var Day=new Array();
Day[1]="Sunday";
Day[2]="Monday";
Day[3]="Tuesday";
Day[4]="Wednesday";
Day[5]="Thursday";
Day[6]="Friday";
Day[7]="Saturday";
return Day[Daynumber];
}
function Monthtxt(Monthnumber) {
var Month=new Array();
Month[1]="January";
Month[2]="February";
Month[3]="March";
Month[4]="April";
Month[5]="May";
Month[6]="June";
Month[7]="July";
Month[8]="August";
Month[9]="September";
Month[10]="October";
Month[11]="November";
Month[12]="December";
return Month[Monthnumber];
}
// stop hiding -->
</script>
</head>
<body>
<table border="0" width="35%" bgcolor="#FFFFFF" align="center">
<tr>
<td id="daycell" style="color:"Blue">
<p align="center">
<script language="javascript">
<!--Hide from non-javascript browsers
var Today=new Date();
var thisDay=Today.getDate();
var thisMonth=Today.getMonth()+1;
var thisYear=Today.getFullYear();
var Dayout=Today.getDay()+1;
var Daysleft=XmasDays(Today);
var Dayname=Daytxt(Dayout);
var Monthname=Monthtxt(thisMonth);
document.write("The Date Today Is : "+Dayname+" "+Monthname+" "+thisDay+", "+thisYear+"<br>");
document.write("There are "+Daysleft+" days until Christmas!");
//stop hiding-->
</script>
</p>
</td>
</table>
</body>
</html>