私はテーブルを持っています...
<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 に移動します。[削除] リンクをクリックすると、確認を求められます。[OK] を選択すると、正しい削除 URL に移動しますが、[キャンセル] を選択すると、削除 URL はキャンセルされますが、行レベルの URL に移動します。どうすればそれを防ぐことができますか?