![](/img/trans.png)
[英]Why AJAX call is not working only on iOS, everywhere else it works great?
[英]Javascript Code not working in Chrome, but works everywhere else
我正在尝试在表头上调用jquery click函数,以使用可排序插件对其进行排序。
jQuery("#orderby").click();
此代码通常计划在文档准备就绪后几毫秒内生效,因为否则它将无法正常工作。 我在Firefox上检查过它,一切都很好。 然后是Chrome,什么也没有,Safari也没有。 我已经检查了IE和Opera,它运行良好。
我通过Chrome中的控制台进行了尝试,但也无法正常工作。 知道我可能会缺少什么吗? 如果您需要其他详细信息,请询问。
<table title="Clasificaciones" summary="" class="leaguemanager standingstable sortable">
<thead>
<tr>
<th class="logo num"> </th>
<th>Equipo</th>
<th id="orderby">GC</th>
<th>Loc</th>
<th>Vis</th>
</tr>
</thead>
<tbody>
<tr class="alternate ascend">
<td class="logo"><img title="Logo" alt="Logo" src="#"></td>
<td><a href="#">Cruz Azul</a></td>
<td class="num">7</td>
<td class="num">4</td>
<td class="num">3</td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
上面的JS就是全部。
您要引用的表头是<thead>
吗? Chrome浏览器可能无法处理广告上的点击事件。
据我了解,您正在尝试模拟表格标题上的click事件。 click()
不会执行此操作-此方法用于定义点击处理函数。
请尝试使用以下代码来模拟表格标题上的click事件:
jQuery("#orderby").trigger(jQuery.Event("click"));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.