我控制器funnction代碼點火器的AJAX錯誤
public function give_form()
{
if($this->session->userdata('use'))
echo "user";
else
echo "sassa";
}
我打電話與阿賈克斯 我的Ajax代碼這個功能是本
function discount(){
alert('hi');
jQuery.ajax({
url: "<?php echo base_url(); ?>" + "index.php/home/give_form",
type: "post",
data: "cityy="+city,
success: function(response) {
alert(response);
}
});
}
我沒有得到來自控制器的任何結果功能可按!
你會得到什麼錯誤?什麼是城市的js數據變量?你的網址是否正確?嘗試在AJAX塊中放入'statusCode:{404:function(){alert('Not Found');}},'。 – Elymentree