문제

I need to load whole table into div with $.ajax, but after that, Datatables 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);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top