0

我有以下片段,这些片段是不言自明的:

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.

任何帮助,将不胜感激。

4

1 回答 1

0

尝试使用:

window.location.search = 'action=delete';
于 2013-03-02T21:02:59.933 回答