2013-03-02 30 views
0

我有以下的片段,這是自我解釋:的Javascript確認和導航

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上添加。

任何幫助,將不勝感激。

+2

無處在您發佈的代碼是有企圖設置任何「已禁用」屬性。 – Pointy 2013-03-02 21:02:09

+0

@Pointy - 我知道..不同的腳本。我不認爲這實際上與此有關。我將從問題 – greycode 2013-03-02 21:05:49

+0

中刪除是iFrame的使用?..你有沒有嘗試Chrome開發工具,看看有什麼問題..大多數這似乎跨域問題? – user1428716 2013-03-02 21:28:14

回答

0

嘗試使用:

window.location.search = 'action=delete'; 
+0

試過這個.. :( – greycode 2013-03-02 21:04:19

+0

我編輯了我的評論,試試吧。 – pdoherty926 2013-03-02 21:10:14

+0

沒有。如果強制用戶重新提交表單,它會影響嗎? – greycode 2013-03-02 21:13:02