我可以看到很多解决此问题的建议,但是作为一个新手,我希望可以轻松直观地解决此问题。
我的URL在域名前包含http。未配置SSL。另外,有些页面在我的其中一个页面不起作用的站点中正常工作,并且在该页面中,我过去每10秒钟通过ajax调用一次控制器/功能。
示例代码:
jQuery.ajax({
type: "POST",
url: '<?= site_url('controller/check_new_data/'.$id)?>',
cache: false,
dataType: "json",
data : {
'id':<?=$id?>
},
success: function (response) {
if(response.value != 0){
if(response.value != <?=$data_count?>){
location.reload();
}
}
},
error: function (response) {
//alert(JSON.stringify(response));
return false;
}
});
xxxxxx页面不起作用
xxxxxx没有发送任何数据。
ERR_EMPTY_RESPONSE
控制器功能如下:
function check_new_data($id){
$record = $this->Iot_lora_data_model->retrieve(array("iot_lora_id" => $id));
$response['value'] = count($record);
echo json_encode($response);
}
非常感谢。