问答详情
源自:2-6 JavaScript-关闭窗口(window.close)

2-6习题,为何将_blank改为_self时下面语句不起作用?

 

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>close()</title>

  <script type="text/javascript">

    var mywin=window.open("http://www.imooc.com",'_blank','top=100,width=400,height=200,left=15');

    var flag=confirm ("点击确定来关闭这个窗口!");

    if (flag==true)

    {

        mywin.close();

    }

  </script>

</head>

<body>

</body>

</html>


提问者:Giedunn 2017-07-23 13:12

个回答