【问题标题】:Redirect jquery ui dialog on close关闭时重定向jquery ui对话框
【发布时间】:2011-04-14 07:28:06
【问题描述】:

我尝试了不同的方法来做到这一点,但我无法让它发挥作用。这是代码:

    $.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? }
    });
    });
});

感谢 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' }
    });
});

【问题讨论】:

  • 你试过 location.href = '你想重定向的地方'

标签: javascript jquery user-interface dialog


【解决方案1】:
    $.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"; }
        });
        });
    });

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

【讨论】:

  • 感谢 dekomote,我已经让它工作了,但你的代码也可以工作:) 谢谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-05-22
  • 2011-11-28
  • 2013-12-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多