How to resloved this alert 1 message on jquery datatables

Viewed 101

I have used the below jquery data tables code.

Data is coming is good but an alert message showed. How to resolve these alerts?

I did not give any alert.No idea where is coming from.

Jquery Code :

var _loadVIPRequests_lst = {};
_loadVIPRequests_lst.init = function()
{
    $('#VIPRequestsTables').DataTable({
        responsive:true,
        "aaSorting":[],
        "order":[ 0, 'DESC' ],
        stateSave: true,
           cache: false,
          async: false,
        ajax: {
            url:pathname+'vip-requests-json',
            type: "post",
        },
        dom:'Bfrtip',
        "columns": [
            
            { "data": "Language" },
            { "data": "comment" },
            {
                "mDataProp": function ( data, type, full, meta) {
                     var $table_fulldata=JSON.stringify(data);
                    var $table_fulldata=$table_fulldata.replace("'","_");
                    $return_data='<button class="btn btn-sm btn-primary btnbox vip-request-edit" href="#"><i class="far fa-edit"></i></button>';
                    $return_data+='<button class="btn btn-sm btn-warning btnbox vip-request-view" href="#"><i class="fas fa-eye"></i></button>';
                    $return_data+='<button class="btn btn-sm btn-danger btnbox vip-request-delete" href="#"><i class="fa fa-trash" aria-hidden="true"></i></button>';
                    $return_data+="<input type='hidden' name='tabledata' class='tabledata' value='"+($table_fulldata)+"'>";
                    return $return_data;                }
            },
        ],
        lengthMenu:[
            [10, 25, 50, -1],
            ['10 rows', '25 rows', '50 rows', 'Show All']
        ],
        buttons: ['pageLength'],
        "buttons": [
            {
                extend: 'pageLength',
                className: "btn btn-default"
            },


            {
                extend: 'excel',
                text: 'Excel',
                title:'VIP Requests Details',
              

            },
            {
                extend: 'csv',
                text: 'csv',
                title:'VIP Requests Details',
              

            },
        ],
    });
}

PHP Code :

$get_result_data=array();
if ($this->security->xss_clean($_POST) === FALSE) {
    $get_result_data=array();
}else{
    $sql="CALL SP(?,?,?)";
    $resultData=$this->db->query($sql,array("","C","30"))->result();
    if($resultData!=NULL) {
        $get_result_data=$resultData;
    }else{
        $get_result_data=array();
    }
}
$send_data['data']= $get_result_data;
echo json_encode($send_data);

Error Image :

enter image description here

I have used the below jquery data tables code.

Data is coming is good but an alert message showed. How to resolve these alerts?

I did not give any alert.No idea where is coming from.

1 Answers

The debug is coming because of the problematic JSON returned by the PHP function. Please check or provide a full description of the problem along with the code

Related