最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - refresh parent page from jquery dialog - Stack Overflow

programmeradmin0浏览0评论

I want to refresh the parent page when I close my jQuery dialog.

this is the code I use for my dialog. I tried top.opener.location but it did not do nothing but put me on top of the page.

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

I want to refresh the parent page when I close my jQuery dialog.

this is the code I use for my dialog. I tried top.opener.location but it did not do nothing but put me on top of the page.

$("#dialog").dialog({ 
    height: 700, 
    width: 600, 
    closeOnEscape: true, 
    title: 'View', 
    close: function(event, ui){ 
        top.opener.location.reload(true); 
    }
}).dialog("open");
Share Improve this question edited Dec 29, 2009 at 12:56 Peter Lindqvist 10.2k3 gold badges43 silver badges60 bronze badges asked Dec 29, 2009 at 12:51 Dejan.SDejan.S 19.1k22 gold badges72 silver badges120 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 15

The jQuery dialog opens on the same page, not in a new window. So simple refresh the current page:

location.reload(true);
发布评论

评论列表(0)

  1. 暂无评论