點擊按鈕后,為什么不能打開新網頁呢
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>window對象</title>
<script type="text/javascript">
?function abb()?
?{
? ? ?alert(“歡迎來到慕課網”);
? ? ?window.open("http://www.baidu.com", "width:600px height:400px");
}
</script>
</head>
<body>
<form>
<input type="button" value="點擊我,打開新窗口" onclick="abb()"/>
</form>
</body>
</html>
2016-11-05
alert里面的引號是中文形式下的,改成英文形式下的就OK了。
2022-03-25
單引號和雙引號基本都是一種概念,但是二者一起出現時,需要特別注意。可以多做一些嘗試