Baskar,

Do not put quotes around the variable name you provide as a parameter
to the eval() function.

For example,

eval( defaultExpression );

NOT

eval( 'defaultExpression' );

HTH,

-Daniel


On Wed, 30 Mar 2005 23:42:10 +0530, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> 
> Hi Daniel,
> 
> Thanks for your reply.
> 
> I am using cocoon 2.1.5 and I am facing a typical problem in this.
> 
> eval( '"temp" + cocoon.session.getAttribute("object").getId()' );
> 
> The above mentioned one works fine.
> 
> But the problem is when iam getting the following expression
> "temp" + cocoon.session.getAttribute("object").getId()
> From the database like
> 
> Var defaultExpression = testMethod.getdefaultExpression();//expr wil get
> the                                     above mentioned expression from
> the database.
> 
> Now if I give eval( ' defaultExpression ' )  it s not evaluating and
> Returns me simply "temp" +
> cocoon.session.getAttribute("object").getId().
> 
> I tried giving
> Var expr = "'" + testMethod.getdefaultExpression() + "'";
> eval(expr);
> 
> But no use.
> 
> Please suggest me a solution for this.
> 
> Regards,
> Baskar

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to