开发者

How to load jquery Datatables into div with ajax call

I need to load whole table into div with $.ajax, but after that, Datatable开发者_如何学JAVAs won't work. Can i do something about it?


Probably, the liveQuery plugin could help in that case.

Live Query utilizes the power of jQuery selectors by binding events or firing callbacks for matched elements auto-magically, even after the page has been loaded and the DOM updated.


$(function(){
  $.get("script.php",function(data){
    $.each(data.items, function(i,item){
      $("#anydiv").prepend(item.element);          
    });
  })
})

In script.php read array of database results into array and :

echo json_encode($results_array);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜