Codice HTML:
<HTML>
<HEAD>
<TITLE>Ora,minuti,secondi </TITLE>
</HEAD>
<BODY bgcolor="white" onLoad="show5()">
<span id="liveclock" style="position:absolute;left:200;top:180;">
</span>
<script language="JavaScript">
<!--
function show5(){
if (!document.layers&&!document.all)
return
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="AM"
if (hours>24){
dn="PM"
hours=hours-24
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here to your desire
myclock="<font size='5' face='Arial' ><b><font size='1'>Data corrente:</font></br>"+hours+":"+minutes+":"
+seconds+" "+dn+"</b></font>"
if (document.layers){
document.layers.liveclock.document.write(myclock)
document.layers.liveclock.document.close()
}
else if (document.all)
liveclock.innerHTML=myclock
setTimeout("show5()",1000)
}
</script>
</body>
</html>
Codice HTML:
<HTML>
<HEAD>
<TITLE>prova2 </TITLE>
<STYLE TYPE="text/css">
#clock {color:blue; font-size:120%} /* Format the clock. */
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
// Check whether IE4 or later.
var MS = navigator.appVersion.indexOf("MSIE");
window.isIE4 = (MS > 0) &&
(parseInt(navigator.appVersion.substring(MS + 5, MS + 6))
>= 4);
function lead0(val) {
// Add leading 0s when necessary.
return (val < 10) ? "0" + val.toString() : val;
}
function buildTime() {
var time = new Date();
var ampm = "AM";
var h = time.getHours();
// Fix military time and determine ampm.
if (h > 24) {
h = h - 24;
ampm = " PM";
}
return lead0(h) + ":" + lead0(time.getMinutes()) + ":" +
lead0(time.getSeconds()) + ampm;
}
function tick() {
// Replace the clock's time with the current time.
document.all.clock.innerText = buildTime();
}
</SCRIPT>
</HEAD>
<BODY bgcolor="white" ONUNLOAD="if (null != window.tmr) clearInterval(window.tmr);" ONLOAD="if (window.isIE4) window.tmr = setInterval('tick()', 999);">
<P>Sono le:
<SPAN ID="clock">
<SCRIPT LANGUAGE="JavaScript">
// Down-level script support --
// output an initial static time.
document.write(buildTime());
</SCRIPT>
</SPAN>
</body>
</html>
Codice HTML:
<HTML>
<HEAD>
<TITLE>prova 3 </TITLE>
</HEAD>
<BODY bgcolor="white" onLoad="show5()">
<span id="liveclock" style="position:absolute;left:150;top:150;">
</span>
<script language="JavaScript">
<!--
function show5(){
if (!document.layers&&!document.all)
return
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="AM"
if (hours>24){
dn="PM"
hours=hours-24
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here to your desire
myclock="<font size='5' face='Arial' ><b><font size='1'>Ora corrente:</font></br>"+hours+":"+minutes+":"
+seconds+" "+dn+"</b></font>"
if (document.layers){
document.layers.liveclock.document.write(myclock)
document.layers.liveclock.document.close()
}
else if (document.all)
liveclock.innerHTML=myclock
setTimeout("show5()",1000)
}
</script>
</body>
</html>
allora entrambi i 3 script dovrebbero essere compatibili con mie e forse ne voi quale mi consigiliate? cioe non ke sapreste uno compatibile con tutti i broswer?