AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with a calendar (in java) with mozilla ...

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> comp.lang.java.javascript
View previous topic :: View next topic  
Author Message
David
Guest





PostPosted: Sun Aug 08, 2004 4:54 pm    Post subject: Problem with a calendar (in java) with mozilla ... Reply with quote



Hello.

I post this message in another group but as i find this group more
appropriated after, i post it again ....

I've got a program in java which is a calendar (souce :
javascript.internet.com ) . It works perfectly with Internet explorer
but not with mozilla/firefox. Perhaps, it is a syntax error ...

In the java consol, i got the error message "Error : d0r0 is not
defined" which is relative (i think) to the line : colum_name =
eval("d"+i+"r"+j);

Any help would be great.

Thanks. Here is the program below ...


<BODY>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original: Scriptbreaker (pieterpareit (AT) hotmail (DOT) com ) -->
<!-- Web Site: http://www24.brinkster.com/scriptbreaker -->
<!-- Begin
var now = new Date();
var month_array = new
Array("january","february","march","April","May","June","July","August","September","October","November","December");
document.write("
document.write("<select name=month
onchange=change_month(this.options.selectedIndex)>");
for(i=0;i<month_array.length;i++)
{
if (now.getMonth() != i)
{document.write ("
}
document.write("</tr>");
}

document.write("</table>");

document.write("</center></from></td></tr></table>");

var show_date = new Date();

function set_cal(show_date)
{
begin_day = new Date (show_date.getYear(),show_date.getMonth(),1);
begin_day_date = begin_day.getDay();
end_day = new Date (show_date.getYear(),show_date.getMonth()+1,1);
count_day = (end_day - begin_day)/1000/60/60/24;
input_table(begin_day_date,count_day);
}
set_cal(show_date);

function input_table(begin,count)
{
init();
j=0;
if (begin!=0){i=begin-1;}else{i=6}
for (c=1;c<count+1;c++)
{
colum_name = eval("d"+i+"r"+j);
if ((now.getDate() == c)&&(show_date.getMonth() ==
now.getMonth())&&(show_date.getYear() == now.getYear()))
{colum_name.style.backgroundColor = "blue";colum_name.style.color =
"white";};
colum_name.innerText = c;
i++;
if (i==7){i=0;j++;}
}
}

function init()
{
for(j=0;j<6;j++)
{
for(i=0;i<7;i++)
{
colum_name = eval("d"+i+"r"+j);
colum_name.innerText = "-";
colum_name.style.backgroundColor ="";
colum_name.style.color ="";
}
}
}

function change_month(sel_month)
{
show_date = new Date(show_date.getYear(),sel_month,1);
set_cal(show_date);
}

function change_year(sel_year)
{
sel_year = sel_year.value;
show_date = new Date(sel_year,show_date.getMonth(),1);
set_cal(show_date);
}
// End -->
</script>
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> comp.lang.java.javascript All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.