Torna al Thread
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language="JavaScript">
<!--
var tick;
function stop() {
clearTimeout(tick);
}
function nowtime()
{
var ut=new Date();
var h,m,s;
var time=" ";
h=ut.getHours();
m=ut.getMinutes();
s=ut.getSeconds();
if(s<=9) s="0"+s;
if(m<=9) m="0"+m;
if(h<=9) h="0"+h;
time+=h+":"+m+":"+s;
// non puoi usare text o value, devi usare l'oggetto document e non window
document.getElementById("Label1").innerHTML = time;
tick=setTimeout("nowtime()",1000);
}
-->
</script>
</head>
<body onload="javascript: nowtime();" onunload="javascript: stop();">
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>