ScottInTexas
06-27-2006, 03:09 AM
I have this code to write a calendar. But I want it written in a div I have set aside.
function writeIt(){
document.write(TheMonth());
document.write("<table border='1px'>");
document.write("<tr><th colspan='7'></th></tr>");
document.write("<tr><th>Sun</th><th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th></tr>");
var offset=getFirstOfMonth();
var lastDay=getLastOfMonth();
document.write("<tr>");
for(var i=0;i<=offset-1;i++){
document.write("<td></td>");
}
for(i=offset+1;i<=(lastDay+offset);i++){
document.write("<td>"+(i-offset)+"</td>");
if(i%7==0)document.write("</tr><tr>");
}
document.write("</table>");
}
And the div is defined as;
<div id="calendargrid">
<script type="text/javascript">
writeIt()
</script>
</div>
the reason I'm doing this is so that I can have interactive calendars without writing asp (cause I don't know php). Besides, this is suppposed to be a throw down easy web page!
Thanks for your help.
function writeIt(){
document.write(TheMonth());
document.write("<table border='1px'>");
document.write("<tr><th colspan='7'></th></tr>");
document.write("<tr><th>Sun</th><th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th></tr>");
var offset=getFirstOfMonth();
var lastDay=getLastOfMonth();
document.write("<tr>");
for(var i=0;i<=offset-1;i++){
document.write("<td></td>");
}
for(i=offset+1;i<=(lastDay+offset);i++){
document.write("<td>"+(i-offset)+"</td>");
if(i%7==0)document.write("</tr><tr>");
}
document.write("</table>");
}
And the div is defined as;
<div id="calendargrid">
<script type="text/javascript">
writeIt()
</script>
</div>
the reason I'm doing this is so that I can have interactive calendars without writing asp (cause I don't know php). Besides, this is suppposed to be a throw down easy web page!
Thanks for your help.