I have an external js file .js and I want to use the following url which fetches me the json data to be used in the datatable.
https://url/admin/farmers/products-data/1 I fetch the json using the url parameter. I just don't know how to add it to the js file.
var dt_project = dt_project_table.DataTable({
ajax: {
'url':"https://url.com/admin/farmers/products-data/{parameter}",
dataSrc: 'products'
}, // JSON file to add data
ordering: false,
columns: [
// columns according to JSON
{ data: '' },
{ data: 'title' },
{ data: 'description' },
{ data: 'code' },
{ data: 'delivery_mode' }
]
});