我有一张桌子...
<table class="data-table">
<thead>
<tr>
<th width="16">ID</th>
<th>Name</th>
<th>Reference</th>
<th>Link</th>
<th>YouTube</th>
<th>Status</th>
<th width="16">Delete</th>
</tr>
</thead>
<tbody>
<tr class="clickable" data-href="/videos/1/">
<td>1</td>
<td>Test Video</td>
<td></td>
<td></td>
<td></td>
<td>
<a href="/videos/delete/1"
onclick="return confirm_delete();">
Delete
</a>
</td>
</tr>
</tbody>
</table>
而且剧本...
<script>
function confirm_delete() {
var result = confirm("Are you sure you want to delete this video?");
return result;
}
</script>
单击该行将转到正确的 URL。单击删除链接要求确认。如果我选择确定,它将采用正确的删除 URL,但如果我选择取消,它会取消删除 URL,但采用行级 URL。我怎样才能防止这种情况?