WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Exposing selected variables to an eval(), Jose Luis Martinez, July 15, 2003
     Re:Exposing selected variables to an eval(), Erik Arvidsson, July 16, 2003

Subject: Re:Exposing selected variables to an eval() From: Erik Arvidsson Date: July 16, 2003
To me your code looks like it does exactly that. Maybe eval is not scoping correctly. In that case you could use new Function instead

var global
function myFunc(){
var a, b, c;
var x, y, z;
(new Function("", sUserJs))();
}


erik

________________________________________________________

Hello,
I'm having trouble thinking of a way to expose selected variables to an eval statement. It has to be this way because the user should be able to "touch" some of my variables, but others not.
An example of this is:
var global
function myFunc(){
var a, b, c;
var x, y, z
eval ("USER JS");
}
I want the user to be able to touch a b and c , but not global x, y, z from within the eval
Can this be done in a simple way?




Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX