Ejemplos en Javascript

Agenda

<HTML>
<HEAD>

<TITLE>Ejemplos Javascript: ejemplo pr???¡ctico </TITLE>

<script language="javascript">
<!-- // start it
function time_display(){
  document.write("<tr><td>")
  for (var t=7;t<13;t++)
    document.write("<td width=40 align=center><font size=-2><b>"+t+"</b><td width=40 align=center><font size=-3>30</font>")
  for (var t=1;t<10;t++)
    document.write("<td width=40 align=center><font size=-2><b>"+t+"</b><td width=40 align=center><font size=-3>30</font></TD>")
  document.write("</tr>")
}

function fill_time(event,beg_hour,half_hour,blocks){
  document.write("<tr><td width=300><font size=-1>"+event+"</td></font>")
  // skip to beginning time
  for (var t=7;t<beg_hour;t++)
    document.write("<td><td>")
  // start half hour past hour (y)
  if (half_hour==y)
    document.write("<td>")
  // 30 minute time blocks
  for (var t=1;t<=blocks;t++)
    document.write("<td  bgcolor='#F0000'><font size=-2 color='#f0000'>.</font>")
  document.write("</tr>")
}
// -->
</script>

</HEAD>

<BODY bgcolor="white">


<CENTER>
<H3>March 18, 1997</h3>
<HR WIDTH=340>
</CENTER>
<TABLE BORDER=1 CELLPADDING=0 WIDTH=75%>
<TD ALIGN=LEFT><B>Desc</td><td colspan=10 align=left><B>AM<td colspan=20 align=center><B>PM</td>
</B>
<script language="javascript">
y="y"
n="n"
time_display()

// activity name, starting time(24 hour clock), half hour start(y/n), blocks(of 30 min.)
fill_time("Nap",8,y,5)
fill_time("Work",18,n,7)
fill_time("Call",7,y,3)
fill_time("Lunch",10,n,8)


time_display()
</script>
</table>


</body>
</html>

Fechas y horarios