[英]Jquery datatables button not working?
Here is my screenshot :这是我的截图:
This is my following code:这是我的以下代码:
<link href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css" rel="stylesheet">
<link href="https://cdn.datatables.net/buttons/1.2.4/css/buttons.dataTables.min.css" rel="stylesheet">
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
</tr>
</tbody>
</table>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script
<Script src="https://cdn.datatables.net/buttons/1.2.4/js/dataTables.buttons.min.js"></script>
<script>
$(document).ready(function() {
$('#example').DataTable( {
dom: 'Bfrtip',
buttons: [
{
text: 'My button',
action: function ( e, dt, node, config ) {
alert( 'Button activated' );
}
}
]
} );
} );
</script>
I'm trying to use this code from https://datatables.net/extensions/buttons/custom .我正在尝试使用https://datatables.net/extensions/buttons/custom 中的此代码。 I dont why my button
button didn't show up.我不知道为什么my button
没有出现。 I was wondering why this code is not working.我想知道为什么这段代码不起作用。 Can anyone please tell me how to use 'jQuery DataTables Button'?谁能告诉我如何使用“jQuery DataTables Button”?
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.2.4/js/dataTables.buttons.min.js"></script>
you have script error.你有脚本错误。 try this one.试试这个。
Screenshot: http://prntscr.com/eazm0r截图: http : //prntscr.com/eazm0r
您没有正确关闭script tag
您在script tag
下方缺少>
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.