[thelist] js eval

Warden, Matt mwarden at odyssey-design.com
Mon Jul 3 10:58:42 CDT 2000


Are you saying that you get an error on the eval() function, or the variable
that produced by eval. The var produced by eval will have to be defined
before hand, else it will give you undefined. If you don't know where it's
barfing...

eval("alert('eval works!');alert(myvar"+dynamicText+");");

if you clarify what the problem is, I'm sure I can help. You can reference
ANYTHING with eval() because what is does is:

a. evaluate the expression
b. *THEN* executes it

so, really, js doesn't even know that the alerts are in eval()s. It's almost
like dynamically writing lines to your script.

HTH,

--
mattwarden
mattwarden.com

----- Original Message -----
From: "dave gray" <davegray at digiweb.com>
To: "Evolt" <thelist at lists.evolt.org>
Sent: Monday, July 03, 2000 10:27 AM
Subject: [thelist] js eval


> i'm getting the dreaded 'undefined' or just plain text all the time when
> trying to make a dynamic reference to a javascript variable... am i trying
> in vain or is this possible? i seem to remember for some reason that you
> might only be able to create dynamic refs to objects in the DOM...
>
> TIA
>
>  -dave
>
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !
>





More information about the thelist mailing list