如何從響應中提取值? 警報輸出是[{「maturitydays」:「120」}] 我只想要價值!我如何獲得價值?
$("#selectCrop").change(function(){ //this ajax will bring default configured crop data
var cropid = $("#selectCrop option:selected").val();
var url = "<?php echo base_url();?>index.php/user/cropConfig/getData";
$.ajax({
data : {'cropid':cropid},
type : 'post',
url : url,
success :function(response) {
alert(response);
}
})
});
@MaximShoustin其實它是一個數組,因此:'響應[0] .maturitydays' –
@ErenTantekin是的,它應該採取0項目第一 –