关闭重定向jquery ui对话框

时间:2021-10-04 19:41:42

I tried different ways to do this but i cant get it work. this is the code:

我尝试了不同的方法,但我不能让它工作。这是代码:

    $.ui.dialog.defaults.bgiframe = true;
$(function() {
    $("#category_edit_dialog").dialog({
        width: 960,
        hide: 'slide',
        position: 'top',
        show: 'slide',
        close: function(event, ui) { redirect here? how? }
    });
    });
});

Thanks dekomote for helping me. At his advice i solved the problem: here is the full working code:

谢谢dekomote帮助我。根据他的建议我解决了问题:这是完整的工作代码:

 $.ui.dialog.defaults.bgiframe = true;
$(function() {
    $("#category_edit_dialog").dialog({
        width: 960,
        hide: 'slide',
        position: 'top',
        show: 'slide',
        close: function(event, ui) { location.href = 'url here' }
    });
});

1 个解决方案

#1


21  

    $.ui.dialog.defaults.bgiframe = true;
    $(function() {
        $("#category_edit_dialog").dialog({
            width: 960,
            hide: 'slide',
            position: 'top',
            show: 'slide',
            close: function(event, ui) { window.location.href = "page.html"; }
        });
        });
    });

where "page.html" is the page you wish to redirect to on close

其中“page.html”是您希望在关闭时重定向到的页面

#1


21  

    $.ui.dialog.defaults.bgiframe = true;
    $(function() {
        $("#category_edit_dialog").dialog({
            width: 960,
            hide: 'slide',
            position: 'top',
            show: 'slide',
            close: function(event, ui) { window.location.href = "page.html"; }
        });
        });
    });

where "page.html" is the page you wish to redirect to on close

其中“page.html”是您希望在关闭时重定向到的页面