问答详情
源自:2-5 JavaScript-打开新窗口(window.open)

为什么加了一个就用不了了?

<!DOCTYPE HTML>

<html>

<head>

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

<title>window.open</title>

<script type="text/javascript">

  function Wopen(){

      window.open('http://www.imooc.com','_blank','width=600,height=400,top=100,left=0')


  }

 function open(){

      window.open('http://www.baidu.com','_blank','width=600,height=400,top=100,left=0')


  }

</script>

</head>

<body>

    <input name="button" type="button" onClick="Wopen()" value="点击我,打开新窗口!" / ><br/>

    <input name="button" type="button" onClick="open()" value="打开新窗口!" / >

</body>

</html>


提问者:weixin_慕码人7591350 2020-08-03 20:36

个回答

  • SpecialMe
    2020-08-03 22:15:03
    已采纳

    相同 name 的窗口只能创建一个,要想创建多个窗口则 name 不能相同。



  • weixin_慕码人7591350
    2020-08-07 19:35:51

    Wopen和open也不一样啊

    难道相似都不行

    把一个换成apple试了一下就可以