Pass Parameters through ajax call – ajax url

I am trying to pass value parameter through the ajax call to the controller. It is a date value. I am struggling to find a way to pass parameters through this ajax url. Please help.

 function dataTable() {
    var value = $("#somedatevalue).val();
    $("#thisTable").DataTable({
        "processing": true,
        "paging": false,

        "language": {
            processing: "<span class='processing-message'><i class='fa fa-circle-o-notch fa-spin'></i> Processing...</span>"
        },
        
        ajax: {

            url: $('table#thisTable').data("ajaxurl"),
            type: "POST",
            datatype: "json",

        },
        "columns": [
            {
                "data": "column1",
            },
            {
                "data": "column2",
            },
            {
                "data": "column3",
            },
            {
                "data": "column4",
            },
            {
                "data": "column5",
            },
            {
                "data": "Url",
                "render": function (data) {
                    return '<a class="btn btn-info" href="' + data + '">Select</a>';
                }
            }
        ],
        "dom": 't<"col-lg-3"l><"col-lg-6"p><"col-lg-3"i>'
    });
}  

18 thoughts on “Pass Parameters through ajax call – ajax url”

Leave a Comment