To start with, eval is evil. Avoid it as much as possible. You don't need
to use eval to do what you want here. Actually it is harder to do what you
want using eval than not.
When something goes wrong, change the eval for an alert and see what is it
that the alert shows. That's what eval will try to execute. In this case,
it will show:
a(Object)
Where Object is probably not defined so function a() will get undefined as
the value of its argument and undefined has no members.
Satyam
----- Original Message -----
From: "lujin.0520" < lujin.0520%40yahoo.com.cn">lujin.0520
yahoo.com.cn>
To: < ydn-javascript%40yahoogroups.com">ydn-javascript
yahoogroups.com>
Sent: Tuesday, April 22, 2008 1:19 AM
Subject: [ydn-javascript] some question about 'eval'
> function a(o) {
> alert(o.a);
> }
> eval('a(' + {a:'abc'} + ')');
>
>
>
> ===========
> it does not work.
> How can I do this?
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
.