问答详情
源自: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() {
  var liu= confirm("你要baidu吗?");
  if(liu==ture)
  {
      window.open('http://www.baidu.com','_blank','width=300,height=400,menubar=no,toolbar=no,status=no,scrollbars=yes');
      }
  else
  {
      alert("1024");
  }
}
</script>
</head>
<body>
<form>
    <input name="button" type="button" onClick="liu()" value="点击我,打开新窗口!">
</form>
</body>
</html>

提问者:慕粉3686312 2016-07-26 23:29

个回答

  • smallyu
    2016-07-26 23:43:12
    已采纳

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

    应该是

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

    是你定义的函数名