ho guardato il codice e l'ho provato: ne ho concluso che il problema è semplicemente che è scritto male ed è per questo che non funziona.
1) l'attributo name del form è sconsigliato perchè obsoleto (almeno così dice visual studio 2005 :master: )
2) una pagina aspx che usa il form senza l'attributo runat=server? :master:
3) il file esterno viene letto benissimo ma genera un bel po' di errori: basta andare in debug e si vede
ho fatto questa variante e mi va bene con IE7, firefox2 e Opera9
pagina
codice:
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Pagina senza titolo</title>
<script language="javascript" src="tuoFile.js" type="text/javascript"> </script>
</head>
<body>
<form id="rclock" action="">
ORARIO DI RIFERIMENTO PER LA TIMBATURA:
<input type="text" style="border-right: 0px solid; border-top: 0px solid; font-weight: bolder; font-size: 12px; border-left: 0px solid; border-bottom: 0px solid; font-family: tahoma; text-align: center; color: white; background: #076390;" name='rdata"[/COLOR]' id="rdata" size="22" />
<input type="text" style="border-right: 0px solid; border-top: 0px solid; font-weight: bolder; font-size: 12px; border-left: 0px solid; border-bottom: 0px solid; font-family: tahoma; text-align: center; color: white; background: #076390;" name="rtime" id="rtime" size="10" />
<hr />
</form>
</body>
</html>
file tuoFile.js esterno (nella stessa directory della pagina)
codice:
window.onload = window_onload;
function window_onload()
{
mytime();
}
function mytime()
{
var x = new Date();
var y = new Date();
var h = x.getHours();
var m = x.getMinutes();
var s = x.getSeconds();
if(s <= 9) s = "0" + s;
if(m <= 9) m ="0" + m;
if(h <= 9) h = "0" + h;
var time = h + ":" + m + ":" + s;
document.getElementById("rtime").value = time;
var dayName = ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"];
var monName = ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"];
var now= new Date();
document.getElementById("rdata").value = dayName[now.getDay()] + " " + now.getDate() + " " + monName[now.getMonth()]+ " " + now.getFullYear() ;
window.setTimeout(mytime, 1000);
}