> > var vName = "otto.name"
> >
> > var vValue = vName
How about
vValue = otto["name"]
Does that help? It's exactly the same as
vValue = otto.name
Hugh
-
Take Surveys. Earn Cash. Influence the Future of IT
Join Source
Hello List,
ok, I did it with eval, but is this too expensive?
Dirk Wellmann schrieb:
> Hello List,
>
> I've a JSON-Object in JavaScript like "otto.name" witch value is "Hans".
> Now I want to access the JSON-Object with a Variable like
>
> var vName = "otto.name"
>
> var vValue = vName
>
> Ok,
Hello List,
I've a JSON-Object in JavaScript like "otto.name" witch value is "Hans".
Now I want to access the JSON-Object with a Variable like
var vName = "otto.name"
var vValue = vName
Ok, I know that this won't work, but now you have an idear what I want
to do or?
Background: I have a Tab