答案 0 :(得分:1)
$.ajax({
url : "url-to-site/index.php/account/getBreedsByTypeID/1",
type:'POST',
dataType: 'json',
success: function(response) {
$("#breeds").attr('disabled', false);
$.each(response,function(key, value)
{
$("#breeds").append('<option value=' + key + '>' + value + '</option>');
});
}
});
答案 1 :(得分:0)
$.ajax({
url : "url-to-site/index.php/account/getBreedsByTypeID/1",
data:{id:selected_animal_type},
type:'POST',
dataType: 'json',
success: function(response) {
$("#breeds").attr('disabled', false);
$.each(response,function(key, value)
{
$("#breeds").append('<option value=' + key + '>' + value.breed_name + '</option>');
});
}
});