因此,每次关闭 jQuery UI 中的特定对话框时,我都希望刷新父页面。我怎样才能做到这一点。
jQuery 代码:
$(document).ready(function() {
var dlg=$('#createTeam').dialog({
title: 'Create a Team',
resizable: true,
autoOpen:false,
modal: true,
hide: 'fade',
width:600,
height:285
});
$('#createTeamLink').click(function(e) {
dlg.load('admin/addTeam.php');
e.preventDefault();
dlg.dialog('open');
});
});
HTML 代码:
<button href="" type="button" id="createTeamLink" class="btn btn-primary custom">Create Team</button>
<div id="createTeam" class="divider"></div>
对话框关闭后如何刷新/重新加载主父页面?
使用对话框关闭事件(http://api.jqueryui.com/dialog/#event-close http://api.jqueryui.com/dialog/#event-close).
var dlg=$('#createTeam').dialog({
title: 'Create a Team',
resizable: true,
autoOpen:false,
modal: true,
hide: 'fade',
width:600,
height:285,
close: function(event, ui) {
location.reload();
}
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)