2011-05-12 58 views
0
<script src="jQuery/jquery.tablesorter.min.js"></script> 
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> 
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> 



$(document).ready(function() { 

    $("#myTable").tablesorter({ 

    }); 

    $("#accordion").accordion({ 
     autoHeight: false, collapsible: true, active: false 
    }); 



}); 

...

<div id="accordion"> 
    <h3><a href="#">First header</a></h3> 
    <div>First content</div> 
    <h3><a href="#">Second header</a></h3> 
    <div>Second content</div> 
</div> 

<table border =1 cellpadding =8 id="myTable" class="tablesorter" WIDTH="80%"> 
<thead> 
<th><h3> Date </h3></th> 
<th><h3> Report </h3></th> 
</thead><tbody> 
<tr> 
<td>row 1, cell 1</td> 
<td>row 1, cell 2</td> 
</tr> 
<tr> 
<td>row 2, cell 1</td> 
<td>row 2, cell 2</td> 
</tr> 
</tbody></table> 
+1

我只看到一個'$ (document).ready(function(){...})' – Aren 2011-05-12 00:14:43

+0

我的意思是我只能得到tablesorter的工作,或手風琴 – 2011-05-12 00:16:03

+3

你是否會拋出任何javascript錯誤?當未處理的錯誤是遇到。 – Aren 2011-05-12 00:17:02

回答

4

的tablesorter jQuery的需要加載後

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> 
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> 
<script src="jQuery/jquery.tablesorter.min.js"></script> 
+0

只是一個註釋任何使用jquery必須加載jquery後加載 – mcgrailm 2011-05-12 11:08:11

相關問題