...

View Full Version : setTimeout()



premshree
08-21-2002, 04:14 PM
Please help me with this line :



setTimeout("funcName('+arg1+','+arg2+','+arg3+','+arg4+')",arg4)


I want to pass arg1, arg2, arg3, arg4 as arguments to the function funcName().

I am having probs using this line.

mordred
08-21-2002, 04:18 PM
setTimeout("funcName('" +arg1+"','" +arg2+'",'"+arg3+"','"+arg4+"')",arg4);

does that work for you?

adios
08-21-2002, 07:30 PM
setTimeout('funcName('+arg1+','+arg2+','+arg3+','+arg4+')',arg4);

You'll only need the extra quotes if the function requires them; this varies from case to case (sometimes strings won't be evaluated as such unless they're there.

A memo to the mods: why is this editor randomly wrapping posted strings - it ruins a lot of code that way. vBulletin doesn't generally do that - a switch?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum