mirror of
https://github.com/DataTables/DataTables.git
synced 2024-12-10 22:24:10 +01:00
53 lines
1.1 KiB
JavaScript
53 lines
1.1 KiB
JavaScript
|
// DATA_TEMPLATE: empty_table
|
||
|
oTest.fnStart( "sServerMethod" );
|
||
|
|
||
|
|
||
|
$(document).ready( function () {
|
||
|
/* Check the default */
|
||
|
var oTable = $('#example').dataTable( {
|
||
|
"bServerSide": true,
|
||
|
"sAjaxSource": "../data_sources/method.php?method=get"
|
||
|
} );
|
||
|
|
||
|
oTest.fnWaitTest(
|
||
|
"Default method was GET",
|
||
|
null,
|
||
|
function () {
|
||
|
// A valid request will place a single row in the table
|
||
|
return $('tbody td').eq(0).html() === '1';
|
||
|
}
|
||
|
);
|
||
|
|
||
|
oTest.fnWaitTest(
|
||
|
"Can make a POST request",
|
||
|
function () {
|
||
|
oSession.fnRestore();
|
||
|
$('#example').dataTable( {
|
||
|
"bServerSide": true,
|
||
|
"sAjaxSource": "../data_sources/method.php?method=post",
|
||
|
"sServerMethod": "POST"
|
||
|
} );
|
||
|
},
|
||
|
function () {
|
||
|
return $('tbody td').eq(0).html() === '1';
|
||
|
}
|
||
|
);
|
||
|
|
||
|
oTest.fnWaitTest(
|
||
|
"Can make a PUT request",
|
||
|
function () {
|
||
|
oSession.fnRestore();
|
||
|
$('#example').dataTable( {
|
||
|
"bServerSide": true,
|
||
|
"sAjaxSource": "../data_sources/method.php?method=put",
|
||
|
"sServerMethod": "PUT"
|
||
|
} );
|
||
|
},
|
||
|
function () {
|
||
|
return $('tbody td').eq(0).html() === '1';
|
||
|
}
|
||
|
);
|
||
|
|
||
|
oTest.fnComplete();
|
||
|
} );
|