daily pastebin goal
81%
SHARE
TWEET

Untitled

a guest Nov 22nd, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function () {
  2.             $('#staff_look').DataTable({
  3.                 'ordering': true,
  4.                 'lengthMenu': [10, 25, 50, 75, 100]
  5.             });
  6.         });
  7.    
  8. $.post("<?php echo base_url('controller/function') ?>", {'id': id},
  9.     function (data)
  10.     {
  11.         if (data.length > 0) {
  12.             $('#tbl_body').find('tr').remove();
  13.             for (j = 0; j < data.length; j++) {
  14.                 $('#tbl_body').append("<tr><td>" + (j + 1) + "</td><td>" + data[j]['reg_no'] + "</td><td>" + data[j]['first_name'] + " " + data[j]['last_name'] + "</td><td>" + data[j]['nic_no'] + "</td></tr>");
  15.             }
  16.         }
  17.     },
  18.     "json"
  19.     );
RAW Paste Data
Top