去掉注釋后可以彈出alert但是點擊按鈕后沒有打開新窗口,求指點
<!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>
2015-06-14
open是保留字,換個函數名
2015-01-16
換個函數名,open貌似是個關鍵字,用個open1什么的試試就知道了。。。