top.returnValue可以吗?我用了没有反应。

解决方案 »

  1.   

    updoown.htm 的iframe里面定义一个变量fileName,存放上传的文件名称。假设 iframe 的名称叫frmSave单击关闭按扭的时候: variables=window.showModalDialog(openURL,"","dialogHeight: 500px; dialogWidth:700px; help: No;status: No; scroll:no;center=yes")function btnCloseClick(){
      var fileName=frmSave.fileName  
      window.returnValue=fileName 
    }
    在index.jsp页面的引用:
    function SetFileName(){
    variables=window.showModalDialog(openURL,"","dialogHeight: 500px; dialogWidth:700px; help: No;status: No; scroll:no;center=yes")
    frm1.fileName=variables}
      

  2.   

    var oClassObj=new new Object();
    oClassObj.value=""
    var obj=showModalDialog("updown.htm",oClassObj,"center:yes;dialogWidth:350px; dialogHeight:40px; status:no; help:no");
    if (obj!=null)
    { ....}
    else
    {alert("放弃")}在frmupdown.htm:
    <script>
    function CancelButton(){
    window.returnValue ="OK";}
    </script>
    在sample1.jsp中加入onload=parent.CancelButton()
      

  3.   

    http://www.csdn.net/Develop/read_article.asp?id=15113showModalDialog()、showModelessDialog()方法使用详解