我有一个包含如下数据的表:
<table>
<tr onclick="window.location='download.php?id=1'">
<td>Program 1<br/>Short Description 1 (<a onclick="$.popup.show('Install Instructions', 'Instructions pulled from DB here')">Instructions</a>)</td>
<td>Added by user and date/time here<td>
<td>Filesize here<td>
<td><a href="edit.php?id=1">Edit</a> - <a href="delete.php?id=1">Delete</a><td>
</tr>
(repeat TRs for more programs pulled from DB)
</table>
我遇到的问题是,当您单击(说明)链接时,它应该会弹出一个带有说明的窗口。它确实做到了,但它也会触发 TR 的 onclick。所以我得到一个弹出窗口,然后它转到download.php。
有什么办法可以阻止它触发 TR 的 onclick 吗?最好使用 jquery,但我也不介意纯 JavaScript 解决方案。