home *** CD-ROM | disk | FTP | other *** search
/ Web Designer 98 (Professional) / WebDesigner 1.0.iso / tutorials / tutorial / 4.txt < prev    next >
Encoding:
Text File  |  1997-06-15  |  865 b   |  81 lines

  1. <script language="javascript">
  2.  
  3. <!-- Clock in Java Script .. Benny Sparano
  4.  
  5. // http://chelsea.ios.com/~benny3/ benny3@chelsea.ios.com
  6.  
  7. var dateform
  8.  
  9. speed=1000
  10.  
  11. len=28
  12.  
  13. tid = 0;
  14.  
  15.  
  16.  
  17. function dodate()
  18.  
  19. {
  20.  
  21.   f.date.value=new Date();
  22.  
  23.   tid=window.setTimeout("dodate()",speed);
  24.  
  25. }
  26.  
  27.  
  28.  
  29. function start(x) {
  30.  
  31.   f=x
  32.  
  33.   tid=window.setTimeout("dodate()",speed);
  34.  
  35. }
  36.  
  37.  
  38.  
  39. function cleartid() {
  40.  
  41.   window.clearTimeout(tid);
  42.  
  43. }
  44.  
  45.  
  46.  
  47. // for some reason on some pages this crashes netscape
  48.  
  49. function Clock()
  50.  
  51. {
  52.  
  53. document.write('<FORM name=dateform><input name=date size=')
  54.  
  55. document.write(len)
  56.  
  57. document.write(' value="Clock: Requires Javascript"></FORM>')
  58.  
  59. start(document.dateform);
  60.  
  61. }
  62.  
  63. // end-->
  64.  
  65. </script>
  66.  
  67. </head>
  68.  
  69. <body>
  70.  
  71. <script language="javascript">
  72.  
  73. // You need a javascript compatible browser to view the following <br>
  74.  
  75. Clock();
  76.  
  77. // end javascipt section <br>
  78.  
  79. </script>
  80.  
  81.