“Akses ke XMLHTTPREQUEST di DataTables” Kode Jawaban

Akses ke XMLHTTPREQUEST di DataTables


function loadDataToTable(url,tableName){

    var dataSet;
    $.get(url), function(responseText) {
        /*assuming the result is the JSON you need. 
        I'm skipping over all of the checks you would do*/
        dataSet = JSON.Parse(responseText)
    };



    $("#"+tableName).DataTable( {
        data: dataSet,
        columns: [
            { title: "Col1" },
            { title: "Col2" },
            { title: "Col3" },
            { title: "Etc." }
        ]
    } );
}

Bewildered Bison

Akses ke XMLHTTPREQUEST di DataTables

processFunction( [{"name": "Ram","age": "21","sex": "Male","occupation": "Doctor"},{"name": "Mohan","age": "32","sex": "Male","occupation": "Teacher"},{"name": "Rani","age": "42","sex": "Female","occupation": "Nurse"},{"name": "Johan","age": "23","sex": "Female","occupation": "Software Engineer"},{"name": "Shajia","age": "39","sex": "Female","occupation": "Farmer"}])
Bennett's Wallaby

Jawaban yang mirip dengan “Akses ke XMLHTTPREQUEST di DataTables”

Pertanyaan yang mirip dengan “Akses ke XMLHTTPREQUEST di DataTables”

Lebih banyak jawaban terkait untuk “Akses ke XMLHTTPREQUEST di DataTables” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya