|
Here is a simple script you can add to your page by adding the following code where you'd like the day of the week to be displayed, like this: |
|
<p align="center"> <script language="JavaScript" type="text/javascript"> <!-- Begin today = new Date(); day = today.getDay(); whatistoday = new Array("Sunday", "Monday", "Tuesday","Wednesday", "Thursday", "Friday", "Saturday"); document.write("<b>Today is " +whatistoday[day]+"</b>"); // End --> </script> </p> |
|
Here is a timestamp which will display the time and date when the current
page was opened, Like this: |
|
<script type="text/javascript" language="JavaScript"> |
|
Here is a simple text clock script which will keep a
running time on your page, Like this: Please Note - this script will also change the page title and the text in the status bar to show the clock as well. You can see the effect of that on this page, but you can change one or both of those as well. |
|
<!-- Clock Part 1 - Holder for Display of Clock --> <b><font size="6"><span id="tP"> </span></font></b> <!-- Clock Part 1 - Ends Here --> <!-- Clock Part 2 - Put Anywhere AFTER Part 1 --> <script type="text/javascript"> // Clock Script Generated By Maxx Blade's Clock v2.0d // http://www.maxxblade.co.uk/clock function tS(){ x=new Date(); x.setTime(x.getTime()); return x; } function lZ(x){ return (x>9)?x:'0'+x; } function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12:x; } function y2(x){ x=(x<500)?x+1900:x; return String(x).substring(2,4) } function dT(){ window.status=''+eval(oT)+''; document.title=''+eval(oT)+''; document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); } function aP(x){ return (x>11)?'pm':'am'; } var dN=new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'),mN=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),oT="dN[tS().getDay()]+' '+tS().getDate()+' '+mN[tS().getMonth()]+' '+y2(tS().getYear())+' '+':'+':'+' '+tH(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '+aP(tS().getHours())"; if(!document.all){ window.onload=dT; }else{ dT(); } </script> <!-- Clock Part 2 - Ends Here --> |
| You can change the text size of the clock by adjusting the font size in Part 1 of the script. You can also eliminate the clock as the page title by using this code instead: |
|
<!-- Clock Part 1 - Holder for Display of Clock --> <b><font size="3"><span id="tP"> </span></font></b> <!-- Clock Part 1 - Ends Here --> <!-- Clock Part 2 - Put Anywhere AFTER Part 1 --> <script type="text/javascript"> // Clock Script Generated By Maxx Blade's Clock v2.0d // http://www.maxxblade.co.uk/clock function tS(){ x=new Date(); x.setTime(x.getTime()); return x; } function lZ(x){ return (x>9)?x:'0'+x; } function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12:x; } function y2(x){ x=(x<500)?x+1900:x; return String(x).substring(2,4) } function dT(){ window.status=''+eval(oT)+''; document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); } function aP(x){ return (x>11)?'pm':'am'; } var dN=new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'),mN=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),oT="dN[tS().getDay()]+' '+tS().getDate()+' '+mN[tS().getMonth()]+' '+y2(tS().getYear())+' '+':'+':'+' '+tH(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '+aP(tS().getHours())"; if(!document.all){ window.onload=dT; }else{ dT(); } </script> <!-- Clock Part 2 - Ends Here --> |
| You can eliminate the clock in the status bar at the bottom by using this code instead: |
|
<!-- Clock Part 1 - Holder for Display of Clock --> <b><font size="6"><span id="tP"> </span></font></b> <!-- Clock Part 1 - Ends Here --> <!-- Clock Part 2 - Put Anywhere AFTER Part 1 --> <script type="text/javascript"> // Clock Script Generated By Maxx Blade's Clock v2.0d // http://www.maxxblade.co.uk/clock function tS(){ x=new Date(); x.setTime(x.getTime()); return x; } function lZ(x){ return (x>9)?x:'0'+x; } function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12:x; } function y2(x){ x=(x<500)?x+1900:x; return String(x).substring(2,4) } function dT(){ document.title=''+eval(oT)+''; document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); } function aP(x){ return (x>11)?'pm':'am'; } var dN=new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'),mN=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),oT="dN[tS().getDay()]+' '+tS().getDate()+' '+mN[tS().getMonth()]+' '+y2(tS().getYear())+' '+':'+':'+' '+tH(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '+aP(tS().getHours())"; if(!document.all){ window.onload=dT; }else{ dT(); } </script> <!-- Clock Part 2 - Ends Here --> |
| You can eliminate both the title and the status bar showing the clock by using this code: |
|
<!-- Clock Part 1 - Holder for Display of Clock --> <b><font size="4"><span id="tP"> </span></font></b> <!-- Clock Part 1 - Ends Here --> <!-- Clock Part 2 - Put Anywhere AFTER Part 1 --> <script type="text/javascript"> // Clock Script Generated By Maxx Blade's Clock v2.0d // http://www.maxxblade.co.uk/clock function tS(){ x=new Date(); x.setTime(x.getTime()); return x; } function lZ(x){ return (x>9)?x:'0'+x; } function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12:x; } function y2(x){ x=(x<500)?x+1900:x; return String(x).substring(2,4) } function dT(){ document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); } function aP(x){ return (x>11)?'pm':'am'; } var dN=new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'),mN=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),oT="dN[tS().getDay()]+' '+tS().getDate()+' '+mN[tS().getMonth()]+' '+y2(tS().getYear())+' '+':'+':'+' '+tH(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '+aP(tS().getHours())"; if(!document.all){ window.onload=dT; }else{ dT(); } </script> <!-- Clock Part 2 - Ends Here --> |
|
[
Network 54 Tech Tips
]
[
Adding a POST button
]
[
Adding Content to Different Pages
]
|
|
|