Hello all,
i'm got stuck with this javascript.
may i know how to convert this javascript to php code.
Anyone can help me?
Thank you, thank you,thank you.
<title>JavaScript Resources - Timer</title>
<script language="JavaScript">
<!--
var secs
var timerID = null
var timerRunning = false
var delay = 1000
function InitializeTimer()
{
// Set the length of the timer, in seconds
secs = 15
StopTheClock()
StartTheTimer()
}
function StopTheClock()
{
if(timerRunning)
clearTimeout(timerID)
timerRunning = false
}
function StartTheTimer()
{
if (secs==0)
{
StopTheClock()
self.status = ""
alert(" 10 seconds")
}
else
{
self.status = secs
secs = secs - 1
timerRunning = true
timerID = self.setTimeout("StartTheTimer()", delay)
}
}
<body onLoad="window.setTimeout('getSecs()',0)">
</body>