為什么沒反應啊
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>window對象</title>
<script type="text/javascript">
function add2(){
window.open('http://www.xianlaiwan.cn','_black','width:600','height:400')
alert("歡迎來到慕課網");
</script>
</head>
<body>
<form>
<input type="button" value="點擊我,打開新窗口" ?onclick="add2()"/>
</form>
</body>
</html>
2016-09-18
_black應該是_blank,另外少了一半‘’{ ‘’
2016-09-18
'width=600','height=400'
2016-09-18
function add2(){
window.open('http://www.xianlaiwan.cn','_blank','width:600','height:400')
alert("歡迎來到慕課網");
}
? 1.alert("歡迎來到慕課網");少了一個“ }? ”;
? 2.'_black'改為“???? '_blank'????????? ”;
? 3.經測試OK。。。
??
2016-09-18
open函數的第二個參數寫錯了,應該是_blank