2009-12-29 111 views
7

我想關閉我的jQuery對話框時刷新父頁面。從jquery對話框刷新父頁面

這是我用於我的對話框的代碼。我試過top.opener.location,但它沒有做任何事情,只是把我放在頁面的頂部。

$("#dialog").dialog({ 
    height: 700, 
    width: 600, 
    closeOnEscape: true, 
    title: 'View', 
    close: function(event, ui){ 
     top.opener.location.reload(true); 
    } 
}).dialog("open"); 

回答

15

jQuery對話框在同一頁面上打開,而不是在新窗口中打開。如此簡單刷新當前頁面:

location.reload(true);