This is a migrated thread and some comments may be shown as answers.

Get object from string

1 Answer 62 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joachim
Top achievements
Rank 1
Iron
Joachim asked on 25 Feb 2016, 03:50 PM

Hi there,

Is there any possibility to get the Object from a String?

my object is  

var Global = { ChartManager: { ChartElements: [] }, ....};

and my string is:

Global.ChartManager.ChartElements

and i want to get back the empty array:

[]

 

Thanks for helping me!

1 Answer, 1 is accepted

Sort by
0
Accepted
Petyo
Telerik team
answered on 29 Feb 2016, 02:54 PM
Hi,

you may use something like JavaScript eval for that purpose. Notice that your question is not related to Kendo UI, so you should be able to find plenty of similar cases online. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Joachim
Top achievements
Rank 1
Iron
Answers by
Petyo
Telerik team
Share this question
or