【发布时间】:2017-03-28 19:13:32
【问题描述】:
我有一个带有提交按钮的页面。单击提交按钮时,我需要显示一个带有一些通知消息的对话框 2 秒。2 秒后,我需要将页面重定向到另一个位置。
setTimeout(function(){
$('#wrapper_dialog').dialog('close');
}, 2000);
//after this popup closes,I need to redirect to another page
window.location = "?load=parents/communication";
当我这样做时,对话框出现并且立即页面异步引导到下一页。
setTimeout(function(){
$('#wrapper_dialog').dialog('close');}, 2000).then(function(){
window.location = "?load=parents/communication";
});
这不起作用。
【问题讨论】:
-
您是否在表单上提交
return false或event.preventDefault()?
标签: jquery settimeout jquery-ui-dialog