Re: Dynamically Change Function Parameters
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Dynamically Change Function Parameters

From: Thomas 'PointedEars' Lahn <PointedEars@web.de>
Date: Mon Jan 23 2006 - 16:05:09 CET

Jasen Betts wrote:

> On 2006-01-20, Wayne Cressman <WCressman@etelligence.com> wrote:
>> var1 = "\'form1\',\'type\',\'#q\',\'0\',\'Please enter your
>> Type.\',\'select\',\'#q\',\'1\',\'Please select your Status.\'";

Escaping ' within a "-delimited string literal is not necessary.

>> YY_checkform(var1);
>>
>> But currently it doesn't work.
>>
>> How do I do this?
>
> eval("YY_checkform("+var1+");");

eval is evil[tm].

YY_checkform.apply(this, var1.split(","));

PointedEars
Received on Tue Feb 7 21:19:13 2006