<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>window对象</title>
<script type="text/javascript">
alert("欢迎大家来我家玩");
function wow(){
window.open(http://www.imooc.com,width=400px,height=300px);
}
</script>
</head>
<body>
<form>
<input type="button" onClick="wow()" value="点击我,打开新窗口" />
</form>
</body>
</html>
open方法里的参数是字符串类型,所以要加上双引号或者单引号。像这种要输网址的,不管三七二十一先弄个引号在写地址。保证没错!
window.open('http://www.imooc.com','width=400px,height=300px'); 加上' '