Page 1 of 1

set parameter problem

Posted: Wed Mar 03, 2004 11:05 pm
by valen53
i have a function countDown()

function countDown(minit,second)
{
.......
counter=setTimeout("countDown()", 1000);
}

the problem is how to put parameter into function ?
any bracket or comma want to add in "minit,second" ?
something like this:
counter=setTimeout("countDown(minit,second)", 1000);

Posted: Thu Mar 04, 2004 4:13 am
by valen53
i make it more clear at here.
actually i ask about java script thing.

Code: Select all

function countDown(me,se ){
countDownTime = se ;
++countDownTime;

if (countDownTime >=10){
countDownTime=countDownInterval;
clearTimeout(counter)
Tminit++
countDown() ;
return
}
counter=setTimeout("countDown()", 1000);    ----- problem here
}
In problem here, i dunno how to set parameter into function :

counter=setTimeout("countDown()", 1000);

Posted: Thu Mar 04, 2004 12:39 pm
by andre_c
you should be able to do it, just get rid of the quotes.

Posted: Wed Mar 10, 2004 11:04 pm
by valen53
counter=setTimeout("countDown(" + me + ", " + se + ")", 1000);