My ajax callback function receives a json object (arraylist parsed into json in another servlet) as a response, and then iterates through it.
Ajax section:
$.ajax({
url:'ServiceToFetchDocType',
data: {"name":name},
type:'post',
cache:false,
success: function(response){
var select = $('#document_subtype');
select.find('option').remove();
$('<option value="">document_subtype</option>').appendTo(select);
$.each(response, function(index, value){
//insert the values into an array
});
callback.apply(select);
}
});
Now, my goal is to store these values into a string array. Any suggestions on how I should proceed?