Invalid Json response

Invalid Json response

Sanandreas81Sanandreas81 Posts: 2Questions: 1Answers: 0

Hello this my js script

$(document).ready(function(){   
    
    var sociData = $('#soci_table').DataTable({
        "searching": false,
        //"lengthChange": false,
        "processing":true,
        "serverSide":true,
        "order":[],
        "ajax":{
            url:"action.php",
            type:"POST",
            data: function ( d ) {
                return $.extend( {}, d, {
                    "nome": $("#nome").val().toLowerCase(),
                    "cognome": $("#cognome").val().toLowerCase(),
                    "registrato": $("#registrato").val().toLowerCase(),
                    "certificato": $("#certificato").val().toLowerCase(),
                    "iscrizione": $("#iscrizione").val().toLowerCase(),
                    "action":'mostra'
                } );
            },
            dataType:"json"
        },
        "columnDefs":[
            {
                "targets":[6],
                "orderable":false,
            },
        ],
        "pageLength": 10
    }); 
        
});

So the php script seems ok but the json respone before the correct draw has this

Array
(
    [draw] => 1
    [columns] => Array
        (
            [0] => Array
                (
                    [data] => 0
                    [name] => 
                    [searchable] => true
                    [orderable] => true
                    [search] => Array
                        (
                            [value] => 
                            [regex] => false
                        )

                )

            [1] => Array
                (
                    [data] => 1
                    [name] => 
                    [searchable] => true
                    [orderable] => true
                    [search] => Array
                        (
                            [value] => 
                            [regex] => false
                        )

                )

            [2] => Array
                (
                    [data] => 2
                    [name] => 
                    [searchable] => true
                    [orderable] => true
                    [search] => Array
                        (
                            [value] => 
                            [regex] => false
                        )

                )

            [3] => Array
                (
                    [data] => 3
                    [name] => 
                    [searchable] => true
                    [orderable] => true
                    [search] => Array
                        (
                            [value] => 
                            [regex] => false
                        )

                )

            [4] => Array
                (
                    [data] => 4
                    [name] => 
                    [searchable] => true
                    [orderable] => true
                    [search] => Array
                        (
                            [value] => 
                            [regex] => false
                        )

                )

            [5] => Array
                (
                    [data] => 5
                    [name] => 
                    [searchable] => true
                    [orderable] => true
                    [search] => Array
                        (
                            [value] => 
                            [regex] => false
                        )

                )

            [6] => Array
                (
                    [data] => 6
                    [name] => 
                    [searchable] => true
                    [orderable] => false
                    [search] => Array
                        (
                            [value] => 
                            [regex] => false
                        )

                )

        )

    [start] => 0
    [length] => 10
    [search] => Array
        (
            [value] => 
            [regex] => false
        )

    [nome] => 
    [cognome] => 
    [registrato] => tutti
    [certificato] => tutti
    [iscrizione] => tutti
    [action] => mostra
)

Answers

Sign In or Register to comment.