Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

javascript question

  • 25-03-2010 08:24PM
    #1
    Closed Accounts Posts: 4


    i have a hash table in java script as below

    this.type_list = $H({ banner: })



    i want to do this :

    var tt = 'type_list'
    var arr = c.tt.get(banner);

    how can i achieve this? thanks.


Comments

  • Closed Accounts Posts: 4 cistov


    Is this what you're trying to do?

    function myConstructor() {
    this.type_list = $H({ banner: });
    }
    var c = new myConstructor();
    var tt = 'type_list';
    var arr = c[tt].get('banner');


  • Users Awaiting Email Confirmation Posts: 351 ✭✭ron_darrell


    mayur wrote: »
    i have a hash table in java script as below

    this.type_list = $H({ banner: })



    i want to do this :

    var tt = 'type_list'
    var arr = c.tt.get(banner);

    how can i achieve this? thanks.

    try this:
    var tt = c.type_list;
    var arr = tt.get(banner);
    


Advertisement