window.open 弹出新窗口的命令;
'page.html' 弹出窗口的文件名;
'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替;
height=100 窗口高度;
width=400 窗口宽度;
top=0 窗口距离屏幕上方的象素值;
left=0 窗口距离屏幕左侧的象素值;
toolbar=no 是否显示工具栏,yes为显示;
menubar,scrollbars 表示菜单栏和滚动栏。
Resizable=no 是否允许改变窗口大小,yes为允许;
location=no 是否显示地址栏,yes为允许;
status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许

父窗体打开页面的javascript

function GoToPage(id)
     {
           
var title="title";
           
var url="xxxxx.aspx?ID="+id+"&Radom="+Math.random();;
           
var Width="700";
           
var Height="600";
           
var arguemnts = new Object();
           arguemnts.window = window;
            if (document.all&&window.print)
            {
                window.showModalDialog(url,arguemnts,
"dialogWidth:" + Width + "px;dialogHeight:" + Height + "px;center:yes;status:no;scroll:yes;help:no;");
                //或者window.showModelessDialog

               //模态窗口在关闭后可以直接在后面跟上刷新的语句

               window.location.reload();
            }
            
else 
           { 
                window.open(url,
"","width=" + Width + "px,height=" + Height + "px,resizable=1,scrollbars=1"); 
           }
        }

在 window.open打开的窗口中,关闭子窗口并刷新父窗口

window.opener.location.reload();window.opener=null;window.close();

在window.showModalDialog打开窗口中,关闭子窗口并刷新父窗口

window.dialogArguments.window.location = window.dialogArguments.window.location; self.close();

posted on 2008-11-16 23:55  Dot-Boy  阅读(3302)  评论(0编辑  收藏  举报