window.open('xxx.asp','zyc','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=640,height=480top=200,left=200'toolbar=no 没有工具栏
location=no  没有地址栏
status=no  没有状态栏
menubar=no  没有菜单条
scrollbars=no  没有滚动条
resizable=yes   允许重新定位

解决方案 »

  1.   

    看来我没说清楚,我知道window.open的用法!我不是问这个!
    我的意思是一个网页,我定义了宽和高,用了这个代码实现:
    window.resizeTo(640,480)
    我想问有没有像windows.open那样可以控制这个网页的,状态栏,工具栏,地址栏显示和隐藏等等!因为默认是全部显示的!
    这里说的不是用window.open功能!谢谢大家
      

  2.   

    <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>
      

  3.   

    谢谢楼上的,无意间收藏好代码!我的原本设计目的是这样的,说个大家听听,看看能不能有其他方法解决:
    一个登陆页面,比如http://127.0.0.1/default.htm
    当输入登陆信息并登陆成功时进入主界面页面interface.htm
    我的要求是进入interface.htm这个页面自动缩放到指定页面的宽和高,这个已经实现!
    原来要问的上面已经说了,如果这个办法不行还有其他办法吗?我原先使用的方式是window.open,通过转接页面loading.htm里面加window.open代码然后打开interface.htm可以做到,问题是原先的登陆页(父)窗口不能关闭,我尝试过把window.close写入loading尾部,可执行到这段代码时提示是否关闭窗口的提示,而不是自动关闭!
    再次请教,谢谢js朋友们!
      

  4.   

    window.opener=null; window.close(); 
    这样关闭就没有提示了