well what is suppost to happen (other scripsts not included since they given in question) is that a year calender with tables in tables...and nothing is appearing on the page so i did something wrong.
and i dont think it is monthNum ++ because in the book it says :
increase the value of munthNum by one
I'm not expert at javascripts, but at least in normal java u need to compile them before they work. http://en.wikipedia.org/wiki/Java_compiler
And the compiler whines if there are errors in the code, and often shows where the errors are.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<script language="JavaScript">
<!--
// vraag om twee getallen,
var getal1 = prompt('Typ een getal in: ', '0');
var getal2 = prompt('Typ nu een tweede getal in: ', '0');
//vergelijk de getallen
var groter = (getal1 > getal2);
var kleiner = (getal1 < getal2);
var gelijk = (getal1 == getal2);
//schrijf de resultaten naar het scherm
document.write('<h1>U voerde de getallen ' + getal1 + ' en ' + getal2 + ' in.</h1><hr>');
document.write('<h2>');
document.write('Is het eerste getal groter dan het tweede getal? : <font color="Red">', groter, '</font><br>');
document.write('Is het eerste getal kleiner dan het tweede getal? : <font color="Red">', kleiner, '</font><br>');
document.write('Is het eerste getal gelijk aan het tweede getal? : <font color="Green">', gelijk, '</font><br>');
document.write('</h2>');
//-->
</script>
just realized there are many errors and they are caused by you. first one is you forgetting how you named your variables. go through the code and debug it line by line
and half the code is missing, wherever you were copying it from, you failed at doing it :p
if (calDate == null) {
calenderDay=new Date() ;
}
i even sometimes confuse myself ;(
monthNum +;
should be monthNum++; ?
and i dont think it is monthNum ++ because in the book it says :
increase the value of munthNum by one
where is 'writeMonth' function btw? you're calling it and i don't see its definion anywhere
var monthNum = - 1
(also in for-loops)
well, int comes from Integer. So it's a variable type for integers (1,2,3...etc, also negative values).
U should use that when u are working with numbers. If u need decimal values, u should use type "double".
This var stuff doesn't look very good to me :p
Does a compiler compile it?
what u mean by that lol?
so should i put int monthNum= -1 ?
And the compiler whines if there are errors in the code, and often shows where the errors are.
yes that notation with int is correct
<html>
<head>
<title></title>
</head>
<body>
<script language="JavaScript">
<!--
// vraag om twee getallen,
var getal1 = prompt('Typ een getal in: ', '0');
var getal2 = prompt('Typ nu een tweede getal in: ', '0');
//vergelijk de getallen
var groter = (getal1 > getal2);
var kleiner = (getal1 < getal2);
var gelijk = (getal1 == getal2);
//schrijf de resultaten naar het scherm
document.write('<h1>U voerde de getallen ' + getal1 + ' en ' + getal2 + ' in.</h1><hr>');
document.write('<h2>');
document.write('Is het eerste getal groter dan het tweede getal? : <font color="Red">', groter, '</font><br>');
document.write('Is het eerste getal kleiner dan het tweede getal? : <font color="Red">', kleiner, '</font><br>');
document.write('Is het eerste getal gelijk aan het tweede getal? : <font color="Green">', gelijk, '</font><br>');
document.write('</h2>');
//-->
</script>
</body>
</html>
and half the code is missing, wherever you were copying it from, you failed at doing it :p