我想基于父下拉选择级联一个下拉列表,我正在使用jquery ajax方法来执行此操作。但是,当我检查页面时,它返回404页面未找到。
我应该在路线中添加任何东西吗?
我在Controller中的方法:
public function get_part_by_part_lookup()
{
$participant_lookup = $this->input->post('participant_lookup_id'),
header('Content-Type: application/x-json; charset=utf-8');
echo(json_encode($this->participant_category_model-
>get_part_by_part_lookup($participant_lookup)));
}
我的观点是:
var participant_lookup_id = $('#participant_lookup').val();
$.ajax({
url:'<?php echo base_url(); ?
>application/controllers/Participants/get_part_by_part_lookup',
type: "POST",
data: {participant_lookup_id: participant_lookup_id},
});
发布于 2019-09-13 17:46:08
var participant_lookup_id = $('#participant_lookup').val();
$.ajax({
url:'<?php echo base_url(); ?>Participants/get_part_by_part_lookup',
type: "POST",
data: {participant_lookup_id: participant_lookup_id},
});
https://stackoverflow.com/questions/57921149
复制相似问题