社区
ASP
帖子详情
关于母窗口与子窗口的参数传递问题
starpan
2003-10-17 10:55:52
我在一个母窗口(send.asp)中调用子窗口(ShowAdd.asp)在传递参数的时候
为什么系统提示"window.opener.document"为空或不是对象呢?谢谢
...全文
61
6
打赏
收藏
关于母窗口与子窗口的参数传递问题
我在一个母窗口(send.asp)中调用子窗口(ShowAdd.asp)在传递参数的时候 为什么系统提示"window.opener.document"为空或不是对象呢?谢谢
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
hover_online
2003-10-17
打赏
举报
回复
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>子父窗口的操作</title>
</head>
<body>
<script>
var win=null;
function op(){
win=window.open("about:blank","win","width=200,height=200");
win.document.write("<input type='button' value='关闭父窗口' onclick='window.opener.opener=null;window.opener.close()'>");
win.document.write("<input type='button' value='刷新你窗口' onclick='window.opener.location.reload()'>");
}
</script>
<input onclick="op()" value="打开窗口" type="button"><input type="button" value="最小化" onclick="if(win&&win.open&&!win.closed){win.resizeTo(0,0);win.moveTo(0,window.screen.width);}else alert('还没有打开窗口或已经关闭')"><input type="button" value="最大化" onclick="if(win&&win.open&&!win.closed){win.moveTo(-4,-4);win.resizeTo(screen.availWidth+8,screen.availHeight+8);}else alert('还没有打开窗口或已经关闭');"><input type=button value="关闭子窗口" onclick="if(win&&win.open&&!win.closed){win.opener=null;win.close()}else alert('还没有打开窗口或已关闭')"><input type=button value="刷新子窗口" onclick="if(win&&win.open&&!win.closed){win.location.reload();win.focus()}else alert('窗口还没有打开或已关闭')"><input type="button" value="看子窗口的大小" onclick="if(win&&win.open&&!win.closed){alert(win.document.body.clientWidth+'*'+win.document.body.clientHeight);win.focus();}else{alert('还没有打开窗口或者已关闭')};">
</body>
</html>
bluemoon0001
2003-10-17
打赏
举报
回复
把onClick="window.open("../account/showAdd.asp","","width=500,height=450")" 换成
onClick="window.open('../account/showAdd.asp','','width=500,height=450')"
因为你的单引号"在这里是不行的,要用'才可以。
starpan
2003-10-17
打赏
举报
回复
我就是用window.opener.mainform这个方法的
lovehwq21
2003-10-17
打赏
举报
回复
直接用window.opener.mainform呢?
starpan
2003-10-17
打赏
举报
回复
send.asp调用子窗口的代码:
<tr>
<td>接收手机:</td>
<td>
<input name="RecipientMobile" size="27" value maxlength="100">
<img src="/images/button/contactse.gif" alt="手机号码簿" border="0" onClick="window.open("../account/showAdd.asp","","width=500,height=450")" style="cursor:hand" align="absbottom">
</td>
</tr>
showadd.asp:
<%@ Language=VBScript %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Address List</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language=javascript>
function filterEmail(multivalue,singlevalue){
alert(multivalue);
var nFirst = 0;
if(multivalue=="") return true;
if(multivalue.indexOf(",")==-1){
if(multivalue==singlevalue) return false;
}
for(var i=0;i<multivalue.length;i++){
if(multivalue.charAt(i)==","){
subvalue = multivalue.substring(nFirst,i);
nFirst = i + 1;
if(subvalue==singlevalue){
return false;
}
}
}
subvalue=multivalue.substring(nFirst,multivalue.length);
if(subvalue==singlevalue) return false;
return true;
}
function SubmitForm(formName) {
var frm = document.edit;
var elms = frm.elements;
var recipient = "";
var contactname = "";
for (var i=0; i<elms.length; i++) {
if (elms[i].type == "checkbox" && elms[i].checked) {
contactname = elms[i].name;
if((elms[i].value!="")&&filterEmail(recipient,elms[i].value)&&filterEmail(window.opener.document.mainform.RecipientMobile.value,elms[i].value)){
recipient +=elms[i].value;
recipient +=",";
}
}
}
if (recipient.length >0)
//alert("success");
recipient = recipient.substring(0,recipient.length-1);
try{
if((contactname == "mobileNum")&&(recipient!="")) {
if(window.opener.document.mainform.RecipientMobile.value == "")
window.opener.document.mainform.RecipientMobile.value = recipient;
else {
window.opener.document.mainform.RecipientMobile.value +=",";
window.opener.document.mainform.RecipientMobile.value += recipient;
}
}
}
catch(e){}
window.close();
}
</script>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="edit" method="post" id="edit">
<table width="90%" cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td width="625" valign="top">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="30" bgcolor="#e1e1e1"> </td>
<td class="titlebg10pt" width="125" bgcolor="#e1e1e1" align="center"><b>
姓名</b></td>
<td class="titlebg10pt" nowrap width="154" bgcolor="#e1e1e1" align="center"><b>
移动电话</b></td>
<td class="titlebg10pt" width="136" bgcolor="#e1e1e1" align="center"><b>
Email</b></td>
</tr>
</table>
<table id="addressList" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#E1E1E1" bordercolordark="#FFFFFF" width="100%">
<%for i = 1 to ubound(name)%>
<tr>
<td align="center" width="30" height="19">
<input type="checkbox" name="mobileNum" value="1">
</td>
<td class="t9pt" width="125" height="19" align="center">
<%=name(i)%> </td>
<td class="t9pt" width="154" height="19" align="center">
<%=mobile(i)%></td>
<td class="t9pt" width="136" height="19" align="center">
<span id="email"><%=email(i)%></span> </td>
</tr>
<%next%>
</table>
<tr>
<div align="center"><a href="javascript:SubmitForm();"><img src="/images/button/done.gif" width="70" height="22" border="0" hspace="0" vspace="5"></a>
<a href="javascript:window.close();"> <img src="/images/button/winclose.gif" width="70" height="22" border="0" hspace="0" vspace="5"></a>
</div>
</td>
</tr>
</table>
xxrl
2003-10-17
打赏
举报
回复
完全代码!
Linux高级bash编程
使用getopts命令来读取传递给脚本的选项/参数. 11-20. "Including"一个数据文件 11-21. 一个没什么用的,source自身的脚本 11-22. exec的效果 11-23. 一个exec自身的脚本 11-24. 在继续处理之前,等待一个进程的结束 ...
Advanced Bash-Scripting Guide <>
使用getopts 命令来读取传递给脚本的选项/参数. 11-20. "Including"一个数据文件 11-21. 一个没什么用的,source 自身的脚本 11-22. exec 的效果 11-23. 一个exec 自身的脚本 11-24. 在继续处理之前,等待一个进程的...
推荐系统实战入门2
比如,今日头条就通过炉火纯青的推荐技术,直接缔造了其
母
公司“字节跳动”超500亿美金的市值。 本课程将首次全面公开推荐技术在BAT中的核心应用从BAT、头条、Google等公司最成熟和先进的算法架构展开,主要内容包括...
新版Android开发教程.rar
开放手机联盟, Open Handset Alliance :是美国 Google 公司与 2007 年 11 月 5 日宣布组建的一个全球性的联 盟组织。这一联盟将会支持 Google 发布的 Android 手机操作系统或者应用软件,共同开发名为 Android 的 ...
(草履虫都可以看懂的)PyQt子
窗口
向主
窗口
传递参数,主
窗口
接收子
窗口
信号、参数。
【代码】(草履虫都可以看懂的)PyQt子
窗口
向主
窗口
传递参数,主
窗口
接收子
窗口
信号、参数。
ASP
28,391
社区成员
357,060
社区内容
发帖
与我相关
我的任务
ASP
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
复制链接
扫一扫
分享
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章