我有一个问题是让jQuery Datatables库在我的Joomla网站表上正确显示. http://datatables.net
脚本是我的表的一半样式,然后放弃(我得到表头颜色更改和文本颜色,但没有数据表控件等).
Firebug也抛出以下错误:
TypeError: oColumn is undefined
Run Code Online (Sandbox Code Playgroud)
在我的Joomla模板index.php中我有以下内容<head>:
<script src="./datatables/js/jquery.js" type="text/javascript"></script>
<script src="./datatables/js/jquery.dataTables.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery('#staff_table').dataTable({
"bLengthChange": true,
"bFilter": true,
"bSort": true,
"bInfo": true,
"bAutoWidth": true
} );
} );
</script>
Run Code Online (Sandbox Code Playgroud)
HTML/PHP看起来像这样:
<h3>Members of Staff</h3>
<p>If you're looking for a member of staff at Tower Road Academy, you'll find their details here.</p>
<table class="staff_table" id="staff_table">
<tr class="staff_table_head">
<th>Name</th>
<th>Job Title</th>
<th>Email Address</th>
</tr>
<?php
$result = mysql_query("SELECT * FROM itsnb_chronoforms_data_addstaffmember");
while($row = …Run Code Online (Sandbox Code Playgroud)