Hurricane Development
Hurricane Development

Reputation: 2464

DataTables Ajax not executing

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?

Upvotes: 0

Views: 2358

Answers (1)

Canaan Etai
Canaan Etai

Reputation: 3765

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" 
  });
});

Upvotes: 1

Related Questions