我尝试了不同的方法来做到这一点,但我无法让它发挥作用。这是代码:
$.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' }
});
});
最佳答案
$.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”是您希望在关闭时重定向到的页面
关于javascript - 关闭时重定向 jquery ui 对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3745427/