set options combobox from ajax in spring mvc

Can I set data from ajax for combobox tag?
I try to use :

success : function(result) {
   for(i = 0; i < result.length; i++) {
   var newOption = '<option value="'+result[i][0]+'">'+
       result[i][1]+'</option>';
   $('#TypeId').append(newOption);
}

but it’s not working, none added data.


Source: ajax

Leave a Reply