You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Keshava Murthy <ke...@bigtec.org> on 2002/11/14 09:27:29 UTC
javascript
Hi,
I need display a clock as a label using javascript in my vm file. for this I
have to assign a javascript variable to variable declared in vm file using
#set method.
Could somene give me the proper syntax for the this. Given below is my
javascript file. I need to assign the variable tDate to the variable $clock
in UpdateClock() function.
<script language="JavaScript">
var clockID = 0;
function UpdateClock() {
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}
var tDate = new Date();
var tDate=tDate.getSeconds();
clockID = setTimeout("UpdateClock()", 1000);
}
function StartClock() {
clockID = setTimeout("UpdateClock()", 500);
}
function KillClock() {
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}
}
</script>
regards,
Keshava Murthy. S
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>