如何更新父窗体

Response.Write(window.opener.location=window.openJavaScript

Response.Write("<script language='javascript'>window.opener.location=window.opener.location.href;</script>")

第一种方案是:
file a.htm

function OpenDialog(url,param)
{
return window.open(url,param, "DialogWidth:450px;DialogHeight:450px;help:no;status:no");
}

file b.htm
<script language="javascript">
function js_do(val)
{
self.opener.document.all.filename.value=val
}
</script>

第二种方案是:
file A.htm
<html>
<script language="javascript">
function OpenDialog(url,param)
{
       return window.showModalDialog(url,param, "DialogWidth:450px;DialogHeight:450px;help:no;status:no");
}

function js_getData(url)
{
return OpenDialog("b.htm","");
}

</script>
<body>
<form name="myFrm">
<input type="text" name="filename" οnclick="this.value=js_getData()">
</form>
</body>
</html>

file b.htm

<html>
<script language="javascript">
function js_do(val)
{
window.returnValue=val;
window.close();
}
</script>
<body>
<form name="myFrm">
<input type="text" name="filename">
<input type="text" name="btnDo" οnclick="js_do(this.form.filename.value)">
</form>
</body>
</html>

 

 

Response.Write("<script language='javascript'>window.opener.document.all.txt1.value="+theValue+";</script>");

本文来源21aspnet,经授权后由javajgs_com发布,观点不代表Java架构师必看的立场,转载请联系原作者。

发表评论