Начало
Детали страницы
Время Box
JavaScript появится небольшая коробка с временем
JavaScript Page Details: Время Box
<!-- TWO STEPS TO INSTALL TIME BOX: 1. Paste the coding into the HEAD of your HTML document 2. Add the last code into the BODY of your HTML document --> <!-- STEP ONE: Copy this code into the HEAD of your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <! > <! > <!-- Begin var Temp; setClock(); function setClock() { Temp = ""; now = new Date(); var CurHour = now.getHours(); var CurMinute = now.getMinutes(); now = null; if( CurHour >= 12) { ampm = 1; } else ampm = 0; if( CurHour > 12 ) { CurHour = CurHour - 12; } if( CurHour == 0 ) CurHour = 12; if( CurMinute < 10 ) CurMinute = "0" + CurMinute; CurHour = "<FONT SIZE=2><B>" + CurHour + ":" + CurMinute + "</B>"; if( ampm == 1 ) CurHour = CurHour + " P.M."; else CurHour = CurHour + " A.M."; Temp = CurHour; } function pathOnly (InString) { LastSlash=InString.lastIndexOf ('/', InString.length-1) OutString=InString.substring (0, LastSlash+1) return (OutString); } // End --> </SCRIPT> <!-- STEP TWO: Put this code into the BODY of your HTML document --> <BODY> <CENTER> <TABLE BGCOLOR="#ffe9bf" cellpadding=3 border=1> <TR><TD align=center> <SCRIPT> document.write( Temp ); </SCRIPT> </TD></TR> </TABLE> </CENTER> <!-- Script Size: 1.41 KB -->