我有以下片段,这些片段是自我解释的:
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
。
任何帮助都将不胜感激。
答案 0 :(得分:0)
尝试使用:
window.location.search = 'action=delete';