中文(繁体)
<!-- http://www.downcodes.com/js --> <!--要完成此效果需要兩個步驟第一步:把以下程式碼加入<head>區域--> 看看狀態欄的效果啊! <SCRIPT LANGUAGE="JavaScript"> <!-- var flasher = false // calculate current time, determine flasher state, // and insert time into status bar every second function updateTime() { var now = new Date() var theHour = now.getHours() var theMin = now.getMinutes() var theTime = "" + ((theHour > 12) ? theHour - 12 : theHour) theTime += ((theMin < 10) ? ": 0" : ":") + theMin theTime += ((flasher) ? " " : " =") theTime += (theHour >= 12) ? " 下午" : " 上午" flasher = !flasher window.status = theTime // recursively call this function every second to keep timer going timerID = setTimeout("updateTime()",1000) } //--> </SCRIPT> <!--第二步:把「onLoad="updateTime() "」加在<body>標記裡例如:--> <body onLoad="updateTime()">