只能在用window.open或window.shoModalDialog打开的窗口中实现这个要求

解决方案 »

  1.   

    例一:window.open方法
    <a href="http://www.sohu.com" onclick=window.open("Sample.htm",null,
        "height=200,width=400,status=no,toolbar=no,menubar=no,location=no")>sohu</a>status 状态栏
    toolbar 工具栏
    menubar 菜单栏
    location 地址栏
    ================================================================================
    例二:window.showModalDialog方法
    <a href="http://www.sohu.com" onclick=window.showModalDialog("Sample.htm",null,
        "center:1;help:0;status:0")>sohu</a>center 是否居中
    help 是否出现帮助按钮
    status 是否出现状态栏
      

  2.   

    window.open("Son.htm",,
        "height=200,width=400,status=no,toolbar=no,menubar=no,location=no")
      

  3.   

    <script language="javascript">
    <!--
    function openwindow( url, winName, width, height) 
    {
    xposition=0; yposition=0;
    if ((parseInt(navigator.appVersion) >= 4 ))
    {
    xposition = (screen.width - width) / 2;
    yposition = (screen.height - height) / 2;
    }
    theproperty= "width=" + width + "," 
    + "height=" + height + "," 
    + "location=0," 
    + "menubar=0,"
    + "resizable=1,"
    + "scrollbars=1,"
    + "status=0," 
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + "," //仅适用于Netscape
    + "screeny=" + yposition + "," //仅适用于Netscape
    + "left=" + xposition + "," //IE
    + "top=" + yposition; //IE 
    window.open( url,winName,theproperty );
    }
    //-->
    </script>