<!DOCTYPE html>
<html>
  <head>
    <script src="https://code.jquery.com/jquery-3.6.3.js"></script>
    <link href="https://nightly.datatables.net/css/dataTables.dataTables.css" rel="stylesheet" type="text/css" />
    <script src="https://nightly.datatables.net/js/dataTables.js"></script>
    <meta charset=utf-8 />
    <title>DataTables - JS Bin</title>
  </head>
  <body>
    <div class="container">
      <table id="example" class="display" width="100%">
        <thead>
          <tr>
            <th>Name</th>
            <th>Position</th>
            <th>Office</th>
            <th>Extn.</th>
            <th>Start date</th>
            <th>Salary</th>
          </tr>
        </thead>
        <tfoot>
          <tr>
            <th>Name</th>
            <th>Position</th>
            <th>Office</th>
            <th>Extn.</th>
            <th>Start date</th>
            <th>Salary</th>
          </tr>
        </tfoot>
      </table>
    </div>
  </body>
</html>
 
DataTable.types().forEach(type => {
  DataTable.type(type, 'detect', () => false);
});
var table = new DataTable('#example', {
  processing: true,
  serverSide: true,
  ajax: {
    url: '/ssp/objects.php',
    type: 'post'
  },
  columns: [
    { data: 'first_name' },
    { data: 'last_name' },
    { data: 'position' },
    { data: 'office' },
    { data: 'start_date' },
    { data: 'salary' ,
     render: function (data, type, row) {
       if (type === 'type') {
         console.log('type detection')
       }
       return data;
     }
    },
  ],
});
1 error 2 warnings
Line 1: 'arrow function syntax (=>)' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).
Line 2: 'arrow function syntax (=>)' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).
Line 21: Missing semicolon.
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers