Tenta trocar o c�digo da fun��o showtime pelo c�digo abaixo:
function showtime()
{
var relogio = document.clock; // acessar o formul�rio
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = "" + ((hours > 12) ? hours -12 :hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? "P.M." : "A.M."
relogio.face.value = timeValue; // atualiza o valor do input-text
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
int�
Paulo Ricardo
Recife - PE
Bruno Mar�al Lacerda Fonseca wrote:
>
> A a� pessoas, preciso de ajuda.
>
> Est� dando uma mensagem de erro na linha "showtime();", mas ela est� correta
> de acordo com o meu exemplo.
> Gostaria que alugu�m assim que puder examinasse este c�digo e me enviasse
> uma resposta.
>
> Obrigado
>
> <script language="JavaScript">
>
> var timerID = null;
> var timerRunning = false;
> var id,pause=0,position=0;
>
> function stopcolock()
> {
> if(timerRunning)
> clearTimeout(timerID);
> timerRunning = false;
> }
>
> function showtime()
> {
> var now = new Date();
> var hours = now.getHours();
> var minutes = now.getMinutes();
> var seconds = now.getSeconds()
> var timeValue = "" + ((hours > 12) ? hours -12 :hours)
> timeValue += ((minutes < 10) ? ":0" : ":") + minutes
> timeValue += ((seconds < 10) ? ":0" : ":") + seconds
> timeValue += (hours >= 12) ? "P.M." : "A.M."
> timerID = setTimeout("showtime()",1000);
> timerRunning = true;
> }
>
> function startclock()
> {
> stopclock();
> showtime();
> }
> </script>
> </head>
>
> <body onload="startclock()">
> <center><h1>REL�GIO</h1>
> <hr>
> <form name="clock" onsubmit="0">
> <input type="text" name="face" size=13 value="">
> </form>
> <hr></center>
>
> </body>
> </html>
>
> Atenciosamente,
>
> Bruno Mar�al Lacerda Fonseca
> Desenvolvimento ICQ: 65526070
> TBA Inform�tica Ltda
>
> * Para n�o receber mais e-mails desta lista envie um e-mail para
>[[EMAIL PROTECTED]]
> e no corpo do email escreva [unsubscribe <seu-email>] ou acesse
>http://apoio.cits.br:8080/guest/RemoteListSummary/javabr
> Veja as mensagens antigas em http://www.mail-archive.com/javabr%40cits.br/
--
___________________________________________________________________
The Internet is a place you go when you want to turn your brain on,
and TV is a place you go when you want to turn your brain off.
( Steve Jobs, Presidente da Apple, Business Week, 25 May 98 )
http://www.businessweek.com/1998/21/b3579165.htm
* Para n�o receber mais e-mails desta lista envie um e-mail para
[[EMAIL PROTECTED]]
e no corpo do email escreva [unsubscribe <seu-email>] ou acesse
http://apoio.cits.br:8080/guest/RemoteListSummary/javabr
Veja as mensagens antigas em http://www.mail-archive.com/javabr%40cits.br/