I have a code javascript
$(document).ready(function() {
//datatables
table_pertanyaan = $('#table_pertanyaan').DataTable({
"processing": true, //Feature control the processing indicator.
"serverSide": true, //Feature control DataTables' server-side processing mode.
"order": [], //Initial no order.
// Load data for the table's content from an Ajax source
"ajax": {
"url": "<?php echo site_url('pertanyaan/ajax_list/')?>/" + id,
"type": "POST"
},
//Set column definition initialisation properties.
"columnDefs": [
{
"targets": [ -1 ], //last column
"orderable": false, //set not orderable
},
],
});
And I have a parameter in URL localhost/ci/edit/87
87 is id.
How to I get variable from URL to use Javascript code?.