我想登陆后自动导向另一个也面时,在这个页面打开一个主窗口(不是打开新窗口),该窗口只有标题栏和状态栏,并且是最大化显示的.我用了window.open,不好使.代码如下:
function openwin(){ 
var h=screen.height;
var w=screen.width; 
window.open("Main.htm","adasdasdad","height=h,width=w,menubar=no,toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,resizable=no"); //写成一行
我想将height和width的值以客户端屏幕宽和高来确定,给他h和w两个变量为什么没作用?要怎么做才可以???

解决方案 »

  1.   

    <script language="javascript">
    function openwin(){ 
    var h=screen.height;
    var w=screen.width; 
    window.open("center.htm","adasdasdad","height="+h+",width="+w+",menubar=no,toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,resizable=no"); 
    }
    openwin();
    </script>
      

  2.   

    在加一句 window.close(); 就好了<script language="javascript">
    function openwin(){ 
    var h=screen.height;
    var w=screen.width; 
    window.open("center.htm","adasdasdad","height="+h+",width="+w+",menubar=no,toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,resizable=no"); 
    window.close();
    }
    openwin();
    </script>
      

  3.   

    <script language="javascript">
    function openwin(){ 
    var h=screen.height;
    var w=screen.width; 
    window.open("center.htm","adasdasdad","height="+h+",width="+w+",menubar=no,toolbar=yes,location=no,directories=no,scrollbars=yes,status=yes,resizable=yes"); 
    window.opener = null;
    window.close();
    }
    openwin();
    </script>
      

  4.   

    你自己看看了http://www.donews.net/uiokyu/archive/2004/12/31/221769.aspx