87,988
社区成员
发帖
与我相关
我的任务
分享我们在写代码的时候经常碰到返回值问题,有些时候返回值需要夹带有用数据。我们将问题建立一个模型,希望有大神能帮助解决一下
第一个页面就是初始母页面 mather.htm
<script language="javascript">
function uploadpic2()
{
var returnstr=window.showModalDialog("son.htm","这个就算是空的也不能少", "center: Yes; help: no; resizable: no; status: No;dialogHeight:300px;dialogWidth:600px");
alert(returnstr);
if(returnstr == undefined)
{ returnstr2 = window.returnValue; }
alert(returnstr2);
}
</script>
<body>
<input type="button" value="showdialog" onclick="uploadpic2()" />
</body>
</html>
第2个页面son.htm我们建立一个iframe
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>上传图片</title>
</head>
<BODY leftMargin=0 topMargin=0 ightMargin=0>
<iframe src="showloadpic.htm" scrolling="yes" width="100%" height="100%" frameborder="0">
</iframe>
</BODY>
</html>
第三个页面 showloadpic.htm 这个是假设操作上传图片名的一个显示界面 点OK按钮把图片名上传,并且返回一个值
<BODY >
奇怪的事情
<form name="fomr1" action="picdoaction.asp" method="post">
<input type="text" name="test2" /> <input type="submit" value="ok" />
</form>
</BODY>
第四个页面 picdoaction.asp 接收图片名并产生一个返回值
<body>
<%
test1=trim(request.form("test2"))
response.Write"-------"
response.Write test1
response.Write"<script> window.returnValue='sucess';</script>"
response.End()
%>
</body>
我们的目的是希望在第四个页面结束后把SUCESS这个传递给mather.htm的returnstr。
希望有懂的大神帮助解决