As mentioned in 3.2.3, the front-end uses $.ajax() in jquery
As long as $this->ajaxReturn(); is not used in the controller, the front-end can receive return data. For example, echo json_encode($data);exit;
But as long as the $this->ajaxReturn() function is used, the front end will execute error: function()