java - How do I iterate through an arraylist? -
i have getarray.jsp
java code outputs array of form :
[{"value":"hi","id":"77","label":"hi there"}, {"value":"hello","id":"21","label":"hello there"}]
the array declared in java :
arraylist<sometype> arr = new arraylist<sometype>();
i ajax load jsp :
$(document).ready(function (e) { $('.container').load('getarray.jsp', function (responsetext, textstatus, xmlhttprequest) { $.each(responsetext, function (index, response) { $('.main').append(response.value); $('.main').append('<br /><br /><br /><br />'); }); }); });
but not getting jquery print anything, though jsp return array mentioned on top.
i know json, how print it?
Comments
Post a Comment