单击关闭按钮后如何重定向?
$(document).ready(function() {
var $dialog = $('<div></div>')
.html('This dialog will show every time!')
.dialog({
autoOpen: false,
title: 'Basic Dialog'
});
$('#opener').click(function() {
$dialog.dialog('open');
// prevent the default action, e.g., following a link
return false;
});
});
答案 0 :(得分:2)
使用
location.href="url";
你可以像这样获得bindevent
//给你的popupid
$('div#popupid').bind('dialogclose', function(event) {
alert('closed');
location.href="new url";
});
答案 1 :(得分:1)
您也可以通过以下方式为close
事件定义回调:
$(document).ready(function() {
var $dialog = $('<div></div>')
.html('This dialog will show every time!')
.dialog({
autoOpen: false,
title: 'Basic Dialog',
close: function(ui, event) {
$(this).dialog('close');
// redirect over here.
}
});
});