gpt4 book ai didi

javascript - 如何在 jQuery 中合并两个 $(document).ready(function()

转载 作者:行者123 更新时间:2023-11-28 16:31:03 24 4
gpt4 key购买 nike

<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>

最佳答案

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>

关于javascript - 如何在 jQuery 中合并两个 $(document).ready(function(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5971989/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com