var url = '<?php echo base_url(); ?>index.php/home_event/view_cal';
$.ajax({
type: "POST",
url: url,
secureuri :false,
dataType: "json",
data: postData,
success: function (data,event_name,event_description,start_date,location)
{
$('.heading_bg').html(event_name);
$('.location_details').html(location);
$('.date_details').html(start_date);
$('.event_content').html(event_description);
}
});
}); return false;
});
在此代码中,成功部分不会替换form.i中的值。我的event_name未显示在heading_bg div.pleas帮助中。
答案 0 :(得分:0)
success
函数的第一个参数将包含所有数据。尝试类似:
success: function(data) {
$('.heading_bg').html(data.event_name);
/* ... */
}
或者您可以检查数据:
success: function(data) {
console.dir(data);
}
检查此处的{strong>成功参数http://api.jquery.com/jQuery.ajax/