Response.Write("<script language='javascript'>window.opener.location=window.opener.location.href;</script>") function OpenDialog(url,param) 第二种方案是: function js_getData(url) </script> file b.htm <html> Response.Write("<script language='javascript'>window.opener.document.all.txt1.value="+theValue+";</script>");
第一种方案是:
file a.htm
{
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");
}
{
return OpenDialog("b.htm","");
}
<body>
<form name="myFrm">
<input type="text" name="filename" onclick="this.value=js_getData()">
</form>
</body>
</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>