用Javascript实现父窗体的更新

王朝html/css/js·作者佚名  2008-05-20
宽屏版  字体: |||超大  

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" onclick="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" onclick="js_do(this.form.filename.value)">

</form>

</body>

</html>

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

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有