weixin_33735676 2014-08-29 02:05 采纳率: 0%
浏览 199

DataTables Ajax无法执行

I am using DataTables version 1.10.2. I am dealing with thousands of data sets so I am using server side processing. I cannot even get the file to run via ajax. I am trying to run the file with test.php which is shown below.

<?php file_put_contents("itworked.txt","itworked"); ?>

I have attempted to create the DataTable with the following tactics, however the file is never created. If I visit the link through a browser then the file is created.

$(document).ready(function() {
  $('#playertimes').dataTable({
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "http://domain.com/HCP/plugins/plugin_Timer/assets/php/test.php" 
  });
});

$(document).ready(function() {
  $('#playertimes').dataTable({
    "serverSide": true,
    "ajax": "http://domain.com/HCP/plugins/plugin_Timer/assets/php/test.php" 
  });
});

Why is the file not being called?

  • 写回答

1条回答 默认 最新

  • weixin_33696822 2014-08-29 04:19
    关注

    Your should read the documentation for datatable 1.10. some changes where made, thought there is still backward compatibility but i think your should stick with the one of 1.10 upward..

    $(document).ready(function() {
      $('#playertimes').dataTable({
        "processing": true,
        "serverSide": true,
        "ajax": "http://domain.com/HCP/plugins/plugin_Timer/assets/php/test.php" 
      });
    });
    
    评论

报告相同问题?

悬赏问题

  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制