TableSorter - Appending table data with ajax

前端之家收集整理的这篇文章主要介绍了TableSorter - Appending table data with ajax前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
$(document).ready(function() { 
    $("table").tablesorter(); 
    $("#ajax-append").click(function() { 
         $.get("assets/ajax-content.html",function(html) { 
             // append the "ajax'd" data to the table body 
             $("table tbody").append(html); 
            // let the plugin know that we made a update 
            $("table").trigger("update");** 
            // set sorting column and direction,this will sort on the first and third column 
            var sorting = [[2,1],[0,0]]; 
            // sort on the first column 
            $("table").trigger("sorton",[sorting]); 
        }); 
        return false; 
    }); 
});

http://tablesorter.com/docs/example-ajax.html

原文链接:https://www.f2er.com/ajax/160770.html

猜你在找的Ajax相关文章