我有以下片段,这些片段是不言自明的:
HTML:
<input
class="button"
style="height:30px; margin-left: 5px; margin-right: auto; vertical-align: middle;"
onclick="disp_confirm();"
tabindex="3"
type="submit"
value="Delete">
JavaScript:
function disp_confirm() {
if (window.confirm('Are you sure you want to delete this user?')) {
window.location.href = 'https://sub.domain.com/details.php?action=delete';
}
}
出于某种原因,这不会导航此页面。我想要的只是基本上重新加载页面并添加一个action=delete
.
任何帮助,将不胜感激。