大神能告诉这里那里错了吗?为什么打不开窗口?

来源:2-5 JavaScript-打开新窗口(window.open)

张晓蛟

2016-06-04 20:37

<!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');

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

写回答 关注

4回答

  • qq_太阳花_6
    2016-06-04 21:32:24
    已采纳

    window.open('http://www.imooc.com','_blank''width=600,height=400,top=100,left=0');这句代码blank和width中间少了一个逗号~

    张晓蛟

    成功了,谢谢。

    2016-06-05 10:17:09

    共 1 条回复 >

  • qq_太阳花_6
    2016-06-04 21:31:05

    可以打开的~重新刷新或者提交看看~

  • Youruncle
    2016-06-04 21:05:00

    也没有像素,宽高

    Yourun... 回复object...

    是我不懂装懂了。对不住

    2016-06-04 21:45:16

    共 2 条回复 >

  • Youruncle
    2016-06-04 21:02:27

    onclick是小写

JavaScript入门篇

JavaScript做为一名Web工程师的必备技术,本教程让您快速入门

738651 学习 · 9561 问题

查看课程

相似问题