Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to dynamically iterate javascript map

    Hi All,

    Can anyone tell me how to iterate javascript map dynamically like java.util.hashmap

    Thanks in advance

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by jdevloper View Post
    Hi All,

    Can anyone tell me how to iterate javascript map dynamically like java.util.hashmap

    Thanks in advance
    probably yes, but in java not javascript forum.
    Ask one of the moderators to move your post in java forum please.

    regards

  • #3
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My intension is to know map in javascript.because i face a problem like
    my server data returns to my javascript as a map which inturn has map of
    maps .so pont is i retrieve value from this map and show it into gui.

    sorry if my intension is wrong

  • #4
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by jdevloper View Post
    My intension is to know map in javascript.because i face a problem like
    my server data returns to my javascript as a map which inturn has map of
    maps .so pont is i retrieve value from this map and show it into gui.

    sorry if my intension is wrong
    maybe my assumption was wrong,
    I don't know java so java.util.hashmap don't tell me too much,
    Will be better if you give more details about your problem and let's hope that somebody else, who know both java and javascript, will help you,

    best regards

  • #5
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    You can iterate through the members of an object via:
    Code:
    for (var key in object) {
        alert([key, object[key]].join("\n\n"));
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •