Get object from string

2 posts, 0 answers
  1. Joachim
    Joachim avatar
    3 posts
    Member since:
    Oct 2010

    Posted 25 Feb Link to this post

    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!

  2. Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 29 Feb Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
Back to Top