用showModalDialog打开的新窗口自动关闭并刷新父窗口

1、父窗口文件index.php

介入如下代码

function OpenDetail(Id)
{
window.showModalDialog("pop.php?id="+Id,"","dialogwidth=550px;dialogheight=450px;status=no;help:no;scroll:yes;resizable:yes");
window.open(this.location,'_self','');//革新本页面,也可以用返回值行动

}

2、pop页面中加如下代码

<base target="_self"/>

这个页面中对数据库操纵后。

在生涯数据库后代 码如下:

<script language='JavaScript'>

alert("数据生涯乐成 !");
self.close();

</script>

猜你喜欢

转载自ammayjxf.iteye.com/blog/1146623