I load data by default like this
My table on html page looks like this
Server answer looks like this
But how to load data by clicking button on the page? For example by clicking button
$('.datatable').dataTable({ "sPaginationType": "bs_full", "bProcessing" : true, "sAjaxSource" : "loadusers.html", "sAjaxDataProp" : "test" });
My table on html page looks like this
<table class="datatable table table-striped table-bordered" id="usertable"> <thead> <th>Name</th> <th>Surname</th> <th>Username</th> </thead> <tbody> </tbody> </table>
Server answer looks like this
return "{ \"test\": [ " + "[ \"name1\", \"surname1\", \"username1\"]," + "[ \"name2\", \"surname2\", \"username3\"]," + "[ \"name2\", \"surname2\", \"username3\"]" + "] }";
But how to load data by clicking button on the page? For example by clicking button
<button id="button1" class="btn btn-primary">Clicker</button>