我有問題讓jQuery Datatables庫在我的Joomla網站表上正常顯示。 http://datatables.netTypeError:當使用jQuery Datatables庫時,oColumn是未定義的
該腳本是造型我的表的一半,然後放棄(我得到表頭顏色改變和文字顏色,但沒有數據表控件等)。
螢火蟲也拋出了以下錯誤:
TypeError: oColumn is undefined
在我的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>
的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 = mysql_fetch_array($result))
{
echo '<tr>';
echo '<td>' . $row['staff_name'] . '</td><td>' . $row['staff_job'] . '</td><td><a href=mailto:"' . $row['staff_email'] . '">' . $row['staff_email'] . '</a>' . '</td>';
echo '</tr>';
}
?>
</table>
謝謝,這是我在同一時間點擊下面輸入的內容:-D –
@IainSimpson是的,我剛剛遇到了這個問題,所以它正好在我頭頂! – hsalama
偉大help..thank你.. – Charmie