This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jQuery : How can I iterate over Java HashMap<Long,String> into Javascript?

 
Saurabh Pillai
Ranch Hand
Posts: 524
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am returning HashMap<Long,String> from server on one of the Ajax calls. How can I iterate over the it to extract key,value pair?

Thank you
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is it being returned? As JSON? Something else? A response must be text so you cannot be returning the actual list.

Using $.getJSON()? Something else?

We need more details.
 
Saurabh Pillai
Ranch Hand
Posts: 524
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear.

It is being returned as an associative array and I was able to access through a simple for loop.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now there's a blast from the past. The term "associative array" is pretty antiquated -- and rightfully so, it isn't very accurate as what it describes isn't any sort of array. The better term to use is object hash.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic