现在的位置: 首页 > 综合 > 正文

window.showmodaldialog 关闭父窗口刷新

2013年07月06日 ⁄ 综合 ⁄ 共 544字 ⁄ 字号 评论关闭
父页面代码:
function add() {
		var url = ctx + "/add";
	    var winArgs="dialogWidth=470px;dialogHeight=450px;status=0;help=0;";
	    window.showModalDialog(url,window,winArgs);
	}

上面代码指定第二个参数为window

子页面处理代码:

<script type="text/javascript">
	$(function() {
		$(".submitBtn").click(function() {
			var url = ctx + '/addStudent';
			var para=$('#stuForm').serialize();
			$.post(url, para, function(data) {
				if(data == "yes"){
    				alert("添加成功!");
    			} else if(data == "no"){
    				alert("添加失败!");
    			} else {
    				alert("系统出错!");
    			}
				window.close();
				dialogArguments.location.reload(true);
			});
		});
	});
</script>

dialogArguments.location.reload(true);

实现刷新效果

抱歉!评论已关闭.