Hi I just can't figure this one out.
I need to use the window["evaluate string into js object"]
because I am converting a web Application into a ChromeOS Chrome app and they do not let you use eval()
to do their content security policy.
My problem is that for basic varibles it is fine, example:
var a = "foo";
var b = window["a"];
This will put "foo" into b no problem. But as soon as I have an object (both global or local) it doesn't work, so if 'a' was an object the code would like something like this:
a.test = "foo";
var b = window["a.test"];
That will not work.
Is there a reason for this? I can't seem to find much info on window[]
in general so wondering if anyway has any insight or at least can point me in the right direction to look.
Thanks