JS window.showModalDialog() 模式对话框返回值

来源:互联网 发布:js代码dos 编辑:程序博客网 时间:2024/05/20 23:03

用window.showModalDialog()   实现
    test1.htm  
    ===================  
    <script>  
      var   a   =   window.showModalDialog("test2.htm")  
      for(i=0;i<a.length;i++)   alert(a[i])  
    </script>  
    test2.htm  
    ===================  
    <script>  
    function   sendTo()  
    {  
      var   a=new   Array("a","b")  
      window.returnValue   =   a  
      window.close()  
    }  
    </script>  
    <body>  
    <form>  
      <input   value="返回"   type=button   onclick="sendTo()">  
    </form>