Javascript表排序器插件不工作
我试图在代码中包含tablesorter插件,但它不起作用。我已经添加了jquery库和tablesorter文件,但它没有做任何事情。这是我的密码: 添加的脚本:Javascript表排序器插件不工作,javascript,html,tablesorter,Javascript,Html,Tablesorter,我试图在代码中包含tablesorter插件,但它不起作用。我已经添加了jquery库和tablesorter文件,但它没有做任何事情。这是我的密码: 添加的脚本: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script type="text/javascript" src="{% static 'MIDIPIRCUSSION_
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" src="{% static 'MIDIPIRCUSSION_APP/jquery.tablesorter.js' %}"></script>
HTML代码:
<div class="jumbotron2">
<div class="container">
<br>
<center>
<table id="myTable" class="table table-dark" style="text-align: center">
<thead>
<tr>
<th>Fecha de Creación</th>
<th>Título</th>
<th>Duracion</th>
<th>Dificultad</th>
{% if not user.is_staff %}
<th>Jugar</th>
{% endif %}
<th>Configurar Bateria</th>
{% if user.is_staff %}
<th>Modificar</th>
<th>Eliminar</th>
{% endif %}
</thead>
{% for cancion in object_list %}
<tbody>
<tr>
<td>{{cancion.creacion}}</td>
<td>{{cancion.titulo}}</td>
<td>{{cancion.duracion}}</td>
<td>{{cancion.dificultad}}</td>
</tbody>
</table>
费查德克雷西翁酒店
蒂图罗
杜拉西翁
困难的
{%如果不是user.is_staff%}
朱加尔
{%endif%}
构型菌群
{%if user.is_staff%}
修正的
Eliminar
{%endif%}
{对象\u列表%中的cancion的百分比}
{{cancion.creacion}
{{cancion.titulo}
{{cancion.duracion}}
{{cancion.deficulatad}
javascript代码:
<script>
$(document).ready(function() {
$("myTable").tablesorter();
});
</script>
$(文档).ready(函数(){
$(“myTable”).tablesorter();
});
选择器无效。。。它应该是$(“#myTable”)
$(“myTable”)
正在查找一个不存在的标记
,我发现了错误。我使用了两种不同的方式来加载jquery,使用了不同的版本,所以我没有使用正确的方式 是的,你说得对。我改变了它,但它仍然没有正常工作。现在,当我点击对de元素排序时,它没有做任何事情,这是一个问题。如果有,它们是什么?