【发布时间】:2017-06-16 11:33:55
【问题描述】:
我是 javascript 新手,我正在尝试组合 2 个 javascript 块,但我崩溃了?
第一块
<script>
$(document).ready(function() {
// Setup - add a text input to each footer cell
$('table.table tfoot th').each( function () {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="'+title+' ARA" />' );
} );
// DataTable
var table = $('table.table').DataTable();
// Apply the search
table.columns().every( function () {
var that = this;
$( 'input', this.footer() ).on( 'keyup change', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
} );
</script>
第二块
$('table.table').DataTable({
"order": [
[0, "desc"]
],
paging: true,
"oLanguage": {
"sUrl": "js/dil/LANGUAGE.json",
}
} );
我想在第一个 javascript 中添加“oLanguage”和“order”行。我该怎么办?
【问题讨论】:
标签: javascript datatables