[thelist] Javascript Eval Help....

.jeff jeff at members.evolt.org
Tue Jul 23 23:41:01 CDT 2002


anthony,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: .jeff
>
> netscape,
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

apologies for calling you a foul name.

;p

<tip type="JavaScript" author=".jeff">

avoid the eval() method.  it's easy with things that are available as properties of objects, but what do you do with top level variables?

the answer is simple -- the self object and bracket notation.

instead of:

eval('foo');

try this:

self['foo'];

</tip>

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/




More information about the thelist mailing list