Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: setTimeout()

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Mumbai, India
    Posts
    218
    Thanks
    0
    Thanked 0 Times in 0 Posts

    setTimeout()

    Please help me with this line :

    Code:
    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.
    Last edited by premshree; 08-21-2002 at 03:19 PM.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    setTimeout("funcName('" +arg1+"','" +arg2+'",'"+arg3+"','"+arg4+"')",arg4);

    does that work for you?

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Code:
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •