去掉注釋后可以彈出alert但是點(diǎn)擊按鈕后沒(méi)有打開(kāi)新窗口,求指點(diǎn)
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>window對(duì)象</title>
<script type="text/javascript">
//alert("歡迎來(lái)到慕課網(wǎng)")
function open(){
? ? window.open("http://www.sina.com","_blank","width=600,height=400")
? ? }
? ??
</script>
</head>
<body>
<form>
<input type="button" value="點(diǎn)擊我,打開(kāi)新窗口" onclick="open()" />
</form>
</body>
</html>
2015-06-14
open是保留字,換個(gè)函數(shù)名
2015-01-16
換個(gè)函數(shù)名,open貌似是個(gè)關(guān)鍵字,用個(gè)open1什么的試試就知道了。。。