我正在 javascript 函数中从我的 codeigniter 视图发出 ajax 请求,但没有任何反应,并且弹出成功警报(ok)
function show_drop_downn(){
document.getElementById("drop_downn").style.visibility = "visible";
$.ajax({
type: "POST",
url: "http://localhost/ok/index.php/search/ajax_delete_ntify",
success: alert('ok'),
});
}
这是我的控制器,它运行完美,当我将 url(用于 ajax 请求)复制粘贴到浏览器中时,一切正常,控制器调用模型并且运行完美
function ajax_delete_ntify()
{
echo "incontroller";
$email=$this->session->userdata('email_of_user');
$this->load->model('search_peoplee');
$data['userid']= $this->search_peoplee->get_userid_from_email($email);
foreach ($data['userid'] as $row)
{
$one=$row->userid;
}
$this->search_peoplee->delete_notifications($one);
return;
}