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