Subj : Re: [spidermonkey]How to: get another variable values from JS? To : laser From : Brendan Eich Date : Thu Jun 30 2005 11:10 am laser wrote: > I also have another question, when I use spidermonkey to excute JS > like: > > var ln = 5; > var ln1; > ln1 = ln*2; > > I can get the values of variable ln1 by using API JS_EvaluateScript and > JSVAL_TO_INT, but how can I get the values of variable ln? The value of a script is the value of the last expression statement evaluated in it. That may be what you mean by "get the value of ln1" (the *rval out parameter of JS_EvaluateScript, for this script). To get ln, you could call JS_GetProperty(cx, global "ln", &v). /be .