Datatables, jquery, title not showing
Datatables, jquery, title not showing
下面是我的数据表的标题行,加载时它不会显示任何内容。。。。我做错了什么?
title: function () {
var today = new Date();
return 'Headcount Per Week - Week ' + myWeekCalc(today) + ',<?php echo $start;?> to <?php echo $finish;?>';
},
function myWeekCalc(date) {
var checkDate = new Date(date.getTime());
// Find
checkDate.setDate(checkDate.getDate() + 185 - (checkDate.getDay()));
var time = checkDate.getTime();
checkDate.setMonth(0); // Compare with Jan 1
checkDate.setDate(1);
return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
}
标题应该是字符串,而不是函数。试着立即执行你的标题功能,就像这样,
title: (function () {
function myWeekCalc(date) {
var checkDate = new Date(date.getTime());
// Find
checkDate.setDate(checkDate.getDate() + 185 - (checkDate.getDay()));
var time = checkDate.getTime();
checkDate.setMonth(0); // Compare with Jan 1
checkDate.setDate(1);
return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
}
var today = new Date();
return 'Headcount Per Week - Week ' + myWeekCalc(today) + ',<?php echo $start;?> to <?php echo $finish;?>';
}())
相关文章:
- jQuery is not loaded
- AngularJS JSON not arriving php
- Javascript/Jquery Blob not showing Chrome PDF
- Fancybox iFrame not showing up
- Datatables, jquery, title not showing
- Javascript eclipse proposal not showing onclick
- gmaps4rails is not showing map
- getElementById not showing up
- IE11 not showing selected list when <s:optiontransfersele
- ng-repeat and json for child pages not showing in li's
- Dojo DataGrid Not Showing
- Javascript not showing .value?
- ng-include is not showing html
- Lightbox not showing Jquery
- uib-popover-template not showing
- Javascript not showing
- Three.js LightMap not showing?
- Bootstrap DateTimePicker (Eonasdan) not showing
- jQuery DatePicker not showing
- BootstrapDialog.alert() not showing up