tags:

views:

895

answers:

1

I know I can display an ArrayList by using

for(i=0;i<data.list.length;i++){
    html += data.list[i] +"<br />";
}

to display the AarryList Object, I tried the same with HashMap object but it simply doesn't work. Thanks in advance.

A: 

A HashMap is converted to an object when serialized to JSON. You can iterate over keys/values using:

for (i in data.map) {
  html += data.map[i] + "<br />";
}
Ayman Hourieh
Awesome! Thanks very much!
Sefler