function writeTime() {
  
  // 获得日期对象
  var today = new Date();  // 从对象中获得信息
  var hours = today.getHours();
  var minutes = today.getMinutes();
  var seconds = today.getSeconds();  // fixTime 使分和秒可以正常显示
  // 对于小于10的数字则在该数字前加一个0
  minutes = fixTime(minutes);
  seconds = fixTime(seconds);  //将时间字符串组合在一起并写出
  var the_time = hours + ":" + minutes + ":" + seconds;
  window.document.the_form.the_text.value = the_time;  //每半秒钟执行一次该函数
  the_timeout= setTimeout('writeTime();',500);}
function fixTime(the_time) {
if (the_time <10) { the_time = "0" + the_time; } return the_time; }

解决方案 »

  1.   

    The JavaScript Calculator
    http://freespace.virgin.net/naeem.malik/calculator.htmFree Award Winning JavaScript Calculators:  financial, auto, algebra, health, time, and more!
    http://www.webwinder.com/wwhtmbin/javacalc.htmlhttp://www.cs.hmc.edu/~jruderma/js/calc/JavaScript Calculators
    http://javascript.internet.com/calculators/JavaScript pocket computer for physics
    http://www.physique.fundp.ac.be/Comp/PhysComp.htmlCalculators
    http://javascript.internet.com/calculators/basic.htmlhttp://www.douze.net/calcul.php
      

  2.   

    <script>
    var WshShell = new ActiveXObject("WScript.Shell");
    var oExec = WshShell.Exec("calc");while (oExec.Status == 0)
    {
         WScript.Sleep(100);
    }WScript.Echo(oExec.Status);
    </script>
    呵呵,这个计算器比较强大