去掉注释后可以弹出alert但是点击按钮后没有打开新窗口,求指点

来源:8-1 window对象

白水向前冲

2015-01-06 16:10

<!DOCTYPE HTML>

<html>

<head>

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

<title>window对象</title>

<script type="text/javascript">

//alert("欢迎来到慕课网")

function open(){

    window.open("http://www.sina.com","_blank","width=600,height=400")

    }

    

</script>

</head>

<body>

<form>

<input type="button" value="点击我,打开新窗口" onclick="open()" />

</form>

</body>

</html>


写回答 关注

2回答

  • kwilove
    2015-06-14 13:02:26

    open是保留字,换个函数名

  • Heson
    2015-01-16 17:04:24

    换个函数名,open貌似是个关键字,用个open1什么的试试就知道了。。。

JavaScript进阶篇

本课程从如何插入JS代码开始,带您进入网页动态交互世界

467395 学习 · 21877 问题

查看课程

相似问题