我正在尝试在codeigniter中读取ajax请求的响应,但现在不能这样做,我尝试了很多方法,但是失败了(stringify,console.log)
向其发送ajax请求的控制器
function func()
{
echo json_encode("a");
}
ajax请求
$.ajax({
type: "POST",
url: "<?php echo base_url(); ?>/index.php/file/func",
data: {},
success: function(result){
//how to alert "a" here??????
},
});
请帮助
答案 0 :(得分:0)
json_encode
代替json_encoded
和
更改://how to alert "a" here?????
致:alert(result);