<script type="text/javascript" language="javascript">
form1 = window.open('http://www.baidu.com','new','top=0,left=0,toolbar=no,menubar=no,location=no, status=yes');form1.resizeTo(screen.availWidth,screen.availHeight);//报错
window.opener = null; 
window.open('','_self');
window.close();
</script>运行这段代码,总是提示拒绝访问,而百度窗口可以正常弹出。(运行环境ie7)

解决方案 »

  1.   

    可以加属性的啊
    height=100,width=100,
      

  2.   

    form1 = window.open('http://www.baidu.com','new','top=0,left=0,height='+ screen.availHeight +',width='+ screen.availWidth +',toolbar=no,menubar=no,location=no, status=yes');
      

  3.   


    <script language="javascript"> 
    form1 = window.open('http://www.baidu.com','new','top=0,left=0,toolbar=no,menubar=no,location=no,status=yes,width='+screen.availWidth+",height="+screen.availHeight);
    window.opener = null; 
    window.open('','_self');
    window.close();
    </script>
      

  4.   

    打开后再操作form1 就是跨域访问了,浏览器会认为是安全问题而拒绝访问。