沒有彈出對話框,也沒有打開新網(wǎng)頁
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>window對象</title>
<script type="text/javascript">
? ? alert("歡迎來到慕課網(wǎng)");
? ? function openW(){
? ? ? ? window.open('http://www.baidu.com' '_blank' 'width=600' 'height=400');
? ? }
</script>
</head>
<body>
<form>
<input type="button" value="點擊我,打開新窗口" ?onclick=openW() />
</form>
</body>
</html>
2017-04-09
onclick=‘’你的沒有引號 ?還有'http://www.baidu.com' '_blank' 'width=600' 'height=400');中間沒有逗號分割開
2017-03-11
function openW(){
? ? ? ? window.open('http://www.baidu.com' '_blank' 'width=600' 'height=400');
? ? }
open()函數(shù)中參數(shù)之間加逗號
function openW(){
? ? ? ? window.open('http://www.baidu.com','_blank','width=600','height=400');
? ? }